home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-26 | 109.4 KB | 2,841 lines | [TEXT/R*ch] |
- C.S.M.P. Digest Tue, 26 Dec 95 Volume 3 : Issue 129
-
- Today's Topics:
-
- Alt.Sources.Mac Archive
- Apple Disk Copy Image Format Needed!
- Apple Events to Eudora to send mail...
- Block copy on 604 slow
- Choosing a Help Authoring Tool
- Events vs. GetKeys
- How do I draw dashed lines?
- Network code on a PPC native project?
- Spheres in Q3D?
- WaitNextEvent & Background Processing
-
-
-
- The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
- (pottier@clipper.ens.fr).
-
- The digest is a collection of article threads from the internet
- newsgroups comp.sys.mac.programmer.help, csmp.tools, csmp.misc and
- csmp.games. It is designed for people who read news semi-regularly and
- want an archive of the discussions. If you don't know what a
- newsgroup is, you probably don't have access to it. Ask your systems
- administrator(s) for details. If you don't have access to news, you
- may still be able to post messages to the group by using a mail server
- like anon.penet.fi (mail help@anon.penet.fi for more information).
-
- Each issue of the digest contains one or more sets of articles (called
- threads), with each set corresponding to a 'discussion' of a particular
- subject. The articles are not edited; all articles included in this digest
- are in their original posted form (as received by our news server at
- nef.ens.fr). Article threads are not added to the digest until the last
- article added to the thread is at least two weeks old (this is to ensure that
- the thread is dead before adding it to the digest). Article threads that
- consist of only one message are generally not included in the digest.
-
- The digest is officially distributed by two means, by email and ftp.
-
- If you want to receive the digest by mail, send email to listserv@ens.fr
- with no subject and one of the following commands as body:
- help Sends you a summary of commands
- subscribe csmp-digest Your Name Adds you to the mailing list
- signoff csmp-digest Removes you from the list
- Once you have subscribed, you will automatically receive each new
- issue as it is created.
-
- The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
- Questions related to the ftp site should be directed to
- scott.silver@dartmouth.edu.
-
- -------------------------------------------------------
-
- >From dnebing@news.epix.net (David Nebinger)
- Subject: Alt.Sources.Mac Archive
- Date: 8 Dec 1995 23:01:46 GMT
- Organization: epix.net
-
- The alt.sources.mac archive is up and active. Currently only anon FTP
- access is supported; I plan to have WWW access ready to go by the end of
- next week.
-
- Point your ftp tool to:
- <ftp://ftp.AmbrosiaSW.com/pub/alt.sources.mac/>
-
- Point your www tool to:
- <http://www.AmbrosiaSW.com/alt.sources.mac/>
-
- I have the archives filled with the files I received before 1/1/95; the
- files that I have collected this year will be appearing in the archive soon.
- The digest for the year will also be published soon.
-
- Dave Nebinger
- <http://www.AmbrosiaSW.com/~dnebing/>
- <mailto:dnebing@AmbrosiaSW.com>
-
- P.S. the IP address for Ambrosia is 206.27.96.210.
-
-
- >From dnebing@news.epix.net (David Nebinger)
- Subject: Alt.Sources.Mac Archive
- Date: 8 Dec 1995 23:01:08 GMT
- Organization: epix.net
-
- The alt.sources.mac archive is up and active. Currently only anon FTP
- access is supported; I plan to have WWW access ready to go by the end of
- next week.
-
- Point your ftp tool to:
- <ftp://ftp.AmbrosiaSW.com/pub/alt.sources.mac/>
-
- Point your www tool to:
- <http://www.AmbrosiaSW.com/alt.sources.mac/>
-
- I have the archives filled with the files I received before 1/1/95; the
- files that I have collected this year will be appearing in the archive soon.
- The digest for the year will also be published soon.
-
- Dave Nebinger
- <http://www.AmbrosiaSW.com/~dnebing/>
- <mailto:dnebing@AmbrosiaSW.com>
-
- P.S. the IP address for Ambrosia is 206.27.96.210.
-
-
- >From dnebing@news.epix.net (David Nebinger)
- Subject: Alt.Sources.Mac Archive
- Date: 8 Dec 1995 22:59:55 GMT
- Organization: epix.net
-
- The alt.sources.mac archive is up and active. Currently only anon FTP
- access is supported; I plan to have WWW access ready to go by the end of
- next week.
-
- Point your ftp tool to:
- <ftp://ftp.AmbrosiaSW.com/pub/alt.sources.mac/>
-
- Point your www tool to:
- <http://www.AmbrosiaSW.com/alt.sources.mac/>
-
- I have the archives filled with the files I received before 1/1/95; the
- files that I have collected this year will be appearing in the archive soon.
- The digest for the year will also be published soon.
-
- Dave Nebinger
- <http://www.AmbrosiaSW.com/~dnebing/>
- <mailto:dnebing@AmbrosiaSW.com>
-
- P.S. the IP address for Ambrosia is 206.27.96.210.
-
-
- ---------------------------
-
- >From Programer <progrmer@tiac.net>
- Subject: Apple Disk Copy Image Format Needed!
- Date: Tue, 5 Dec 1995 13:14:10 -0500
- Organization: The Internet Access Company
-
-
- Does anyone know where i can find or can send me the format to Apple's
- Disk Copy utilties....I have a need to read in those Image files and I
- need to know how they are layed out compared to the real disk!
-
- Thanks in advance!
-
- Marek
- progrmer@tiac.net
- http://www.cs.brandeis.edu/~progrmer
-
-
-
- +++++++++++++++++++++++++++
-
- >From jonpugh@netcom.com (Jon Pugh)
- Date: Mon, 11 Dec 1995 01:16:08 GMT
- Organization: Apple Computer
-
- In article <Pine.SUN.3.91.951205131345.544B-100000@sunspot.tiac.net>,
- Programer <progrmer@tiac.net> wrote:
-
- > Does anyone know where i can find or can send me the format to Apple's
- > Disk Copy utilties....I have a need to read in those Image files and I
- > need to know how they are layed out compared to the real disk!
-
- The MungeImage source contains this information.
-
- <ftp://mirror.apple.com//mirrors/Info-Mac.Archive//dev/src/
- munge-image-120-p.hqx>
-
- Jon
-
- ---------------------------
-
- >From cwatson@cam.org (Sean McBride)
- Subject: Apple Events to Eudora to send mail...
- Date: Sun, 03 Dec 1995 16:48:56 -0500
- Organization: Communications Accessibles Montreal, Quebec Canada
-
- I'm wondering if someone can point me in the right direction of
- information pertaining to sending apple events (to Eudora for example) to
- create a new piece of mail to sent to a person.
-
- I've seen lots of programs do this, CyberFinder for example...
-
- Thanks in advance!
-
- _______________________________________________________________________
- H H | | |
- | | | Sean McBride | |
- H-C-C-O-H | cwatson@cam.org | If you drink, don't drive. |
- | | | Montreal, Canada | Crawl home |
- H H | | 0010 1001 1010 |
- - ---------------------------------------------------------------------
-
- +++++++++++++++++++++++++++
-
- >From sgruby@qualcomm.com (Scott Gruby)
- Date: Tue, 05 Dec 1995 17:20:26 -0800
- Organization: QUALCOMM, Inc.
-
- In article <cwatson-0312951648570001@cwatson.hip.cam.org>, cwatson@cam.org
- (Sean McBride) wrote:
-
- > I'm wondering if someone can point me in the right direction of
- > information pertaining to sending apple events (to Eudora for example) to
- > create a new piece of mail to sent to a person.
- >
- > I've seen lots of programs do this, CyberFinder for example...
- >
- > Thanks in advance!
-
- You can find some example code at:
-
- <ftp://ftp.qualcomm.com/quest/mac/eudora/scripts/c-samples.hqx>
-
- (There are some minor mistakes with it, but it should lead you in the
- right direction.)
-
- --
- Scott Gruby
- sgruby@qualcomm.com
-
- +++++++++++++++++++++++++++
-
- >From fairgate@vespucci.iquest.com (Fairgate Technologies)
- Date: 8 Dec 1995 22:49:09 -0600
- Organization: interQuest Online Services -- Huntsville, AL
-
- cwatson@cam.org (Sean McBride) writes:
-
- >I'm wondering if someone can point me in the right direction of
- >information pertaining to sending apple events (to Eudora for example) to
- >create a new piece of mail to sent to a person.
-
- Check out
- ftp://ftp.qualcomm.com/quest/mac/eudora/scripts/new-message.hqx. It's
- a sample that should point you in the right direction. The sample code
- has some bugs but you'll find them fairly quickly :)
-
- Cheers,
- -Paul
-
- --
- Paul Robichaux paul@fairgate.com Fairgate Technologies
- Fairgate Technologies does custom Mac & WWW development.
- <URL:http://www.fairgate.com>
- <URL:http://www.fairgate.com/people/paul/index.html>
-
- +++++++++++++++++++++++++++
-
- >From rac@intrigue.com (Robert Coie)
- Date: Mon, 11 Dec 1995 11:56:31 -0800
- Organization: Intrigue Corporation
-
- In article <cwatson-0312951648570001@cwatson.hip.cam.org>, cwatson@cam.org
- (Sean McBride) wrote:
-
- : I'm wondering if someone can point me in the right direction of
- : information pertaining to sending apple events (to Eudora for example) to
- : create a new piece of mail to sent to a person.
- :
- : I've seen lots of programs do this, CyberFinder for example...
- :
- : Thanks in advance!
-
- I believe the Aretha release has tools to do this
- <http://www.hotwired.com/staff/userland/aretha/>, and Qualcomm's FTP site
- has a document with info about the scripting interface to Eudora.
-
- Robert Coie
- Implementor, Intrigue Corporation
- rac@intrigue.com
-
- ---------------------------
-
- >From steele@isi.edu (Craig S. Steele)
- Subject: Block copy on 604 slow
- Date: Tue, 5 Dec 1995 18:30:53 -0800
- Organization: USC Information Sciences Institute
-
- I'm trying to benchmark block copy rates of various sizes for PowerPCs. My
- results are disappointing for the 604, and cause me to wonder what it is I
- don't understand. Testing on a 9500/120, to which I have limited access, gives
- the following results for copy code using 32-bit integer and 64-bit double
- load and stores, respectively:
-
- Asm lvector copy of 1024 doubles in 44.8 nS/acc, 5.4 clocks/acc, 85.1 MB/s
- Asm dvector copy of 1024 doubles in 34.1 nS/acc, 4.1 clocks/acc, 111.9 MB/s
-
- The source array is aligned to 4K, the destination array to 4K+0x100, to avoid
- possible aliasing interlocks. The source array is preloaded immediately
- before the copy routine is called, so I would expect everything to run at L1
- cache rates.
-
- I would naively expect the copy code to average about 1.5 clocks per load or
- store. Instead, my code reports over 4 clocks/access. The code uses the
- time-base register for timing, which shouldn't cause significant cache
- disturbance.
-
- Can anyone contradict, corroborate, or explain my poor results? If I can't do
- better than this, we'll have to build extra hardware :-(
- Thanks in advance.
- -Craig
-
- exportf2 dvec_copy
- mtctr r5 ; init loop counter
- addi r3,r3,-8 ; predecrement pointer by double size
- addi r4,r4,-8 ; predecrement pointer by double size
- li r6,8 ; cache line alignment constant for dcbz
- b dvc_1
- align 6
- dvc_1
- dcbz r6,r3 ; kill dest. cache line
- lfd fp0,8(r4)
- lfd fp1,16(r4)
- lfd fp2,24(r4)
- lfdu fp3,32(r4)
- stfd fp0,8(r3)
- stfd fp1,16(r3)
- stfd fp2,24(r3)
- stfdu fp3,32(r3)
- bdnz dvc_1 ; test loop condition
- blr
-
-
-
- Craig S. Steele - Not yet Institutionalized
-
-
-
- +++++++++++++++++++++++++++
-
- >From rbarris@netcom.com (Robert Barris)
- Date: Wed, 6 Dec 1995 09:46:47 GMT
- Organization: NETCOM On-line Communication Services (408 261-4700 guest)
-
- In article <9512051830.AA53505@kandor.isi.edu>,
- Craig S. Steele <steele@isi.edu> wrote:
- >I'm trying to benchmark block copy rates of various sizes for PowerPCs. My
- >results are disappointing for the 604, and cause me to wonder what it is I
- >don't understand. Testing on a 9500/120, to which I have limited access, gives
- >the following results for copy code using 32-bit integer and 64-bit double
- >load and stores, respectively:
- >
- >Asm lvector copy of 1024 doubles in 44.8 nS/acc, 5.4 clocks/acc, 85.1 MB/s
- >Asm dvector copy of 1024 doubles in 34.1 nS/acc, 4.1 clocks/acc, 111.9 MB/s
-
- OK, in regular "bytes", you appear to be moving (for examples sake)
- 8192 bytes
- from address (say) 0x1000000
- to address (say) 0x1002100.
-
- So you are reading 8K and writing 8K as I read it... in a perfect world
- all of your data would fit (precisely) into the L1 d cache.
-
- >The source array is aligned to 4K, the destination array to 4K+0x100, to avoid
- >possible aliasing interlocks. The source array is preloaded immediately
- >before the copy routine is called, so I would expect everything to run at L1
- >cache rates.
-
- Except that you are sharing that L1 with things like interrupt tasks, 68K
- interrupt tasks (which invoke the emulator causing additional pollution),
- and so on.
-
- Since as far as I know, there is no way to completely shut off PowerPC
- interrupts, quantifying the effect of background processes on your cache
- population can be a bit tricky.
-
- >I would naively expect the copy code to average about 1.5 clocks per load or
- >store. Instead, my code reports over 4 clocks/access. The code uses the
- >time-base register for timing, which shouldn't cause significant cache
- >disturbance.
-
- When you say per access, do you mean per double "moved" as in a read and
- a write, or per double accessed, as in the read or the write alone?
-
- I guess I can work it out: 110MB/s (say it's 120 for arguments sake) is
- about 1MB per million clocks (at 120MHz). Or about a byte moved per clock, or
- a double moved per 8 clocks. OK so that's 4 per double read, 4 per
- double write (on average).
-
- Suggestions:
- 1. Plot speed versus vector length. Look for nonlinearities.
- (deliberately shrink or grow the vector).
-
- 2. wiggle that 256 byte offset factor some more. or make it zero.
- I do not think the 4-wayness would become a problem until you went
- above 8K vectors, then very little would help...
-
- 3. think about cache hinting at or near the bottom of the loop.
- if for some reason a cache line which you are going to read from
- has been dropped, it's good to schedule its re-fetch as far ahead as
- possible. I'm sure Tim Olson can elaborate much more better good :)
-
- 4. I hear Exponential Technology has a faster BiCMOS 604 coming...
-
- Rob Barris
- Quicksilver Software Inc.
- rbarris@quicksilver.com
- * opinions expressed not necessarily those of my employer *
-
- +++++++++++++++++++++++++++
-
- >From steele@isi.edu (Craig S. Steele)
- Date: Wed, 6 Dec 1995 12:41:15 -0800
- Organization: USC Information Sciences Institute
-
- In article <rbarrisDJ5sHz.MJy@netcom.com>, rbarris@netcom.com (Robert Barris)
- writes:
- > In article <9512051830.AA53505@kandor.isi.edu>, Craig S. Steele
- > <steele@isi.edu> wrote:
- > >I'm trying to benchmark block copy rates of various sizes for
- > >PowerPCs. My results are disappointing for the 604, and cause me
- > >to wonder what it is I don't understand. Testing on a 9500/120, to
- > >which I have limited access, gives the following results for copy
- > >code using 32-bit integer and 64-bit double load and stores,
- > >respectively:
- > >
- > >Asm lvector copy of 1024 doubles in 44.8 nS/acc, 5.4 clocks/acc, 85.1
- MB/s
- > >Asm dvector copy of 1024 doubles in 34.1 nS/acc, 4.1 clocks/acc, 111.9
- MB/s
-
- > So you are reading 8K and writing 8K as I read it... in a perfect
- > world all of your data would fit (precisely) into the L1 d cache.
- Exactly. However, I did benchmark a range of copy sizes from 512B to 1MB; the
- quoted 8KB block results were the fastest. Needless to say the rate for
- larger blocks dropped precipitously as the sizes busted (burst?) the L1 and L2
- caches.
-
- > >...so I would expect everything to run at L1 cache rates.
- > Except that you are sharing that L1 with things like interrupt
- > tasks, 68K interrupt tasks (which invoke the emulator causing
- > additional pollution), and so on.
- True. I would have thought that at least some of my trials would have fit in
- between interrupts, e.g., the critical part of the 8KB case only takes about
- 100uS, and the smaller proportionately less. I also tried back-to-back copy
- calls, producing essentially identical results. I did get _much_ worse results
- when I experimented with using the MacOS Microseconds call for timing, so the
- cache pollution issue is very real. What is the highest rate interrupt source
- on an idle PowerMac anyway?. Is Microseconds non-native? I'm clueless.
-
- > Since as far as I know, there is no way to completely shut off
- > PowerPC interrupts, quantifying the effect of background processes on
- > your cache population can be a bit tricky.
- I believe I know how to do it on an 8100 (although not the 9500) so it's
- probably worth a (probable deathcookies) experiment to see it if makes a
- difference there. I deeply regret having blown up our only hardware prototype
- last month... Maybe next week I'll have a bare machine again, knock on
- Formica(TM).
-
- > >I would naively expect the copy code to average about 1.5 clocks per
- > >load or store. Instead, my code reports over 4 clocks/access.
- > I guess I can work it out ... OK so that's 4 per double
- > read, 4 per double write (on average).
- Yes.
-
- > Suggestions:
- > 1. Plot speed versus vector length. Look for nonlinearities.
- > (deliberately shrink or grow the vector).
- For a 9500/120:
- 512B 49 MB/s
- 1KB 68
- 2KB 87
- 4KB 109
- 8KB 112
- 16KB 68
- 32KB 62
- 64KB 54
- 128KB 53
- 256KB 40
- 512KB 35
- 1024KB 32
-
- The trends are reasonable, it's just the L1 peak rate that seems very low to
- me. The 6100 and 8100, on the other hand, have some huge huge anomalous dips
- for 128KB operations, presumably managing to evict the code from both the L1 &
- L2 unified caches in some particularly malign way.
-
- > 2. wiggle that 256 byte offset factor some more. or make it zero.
- Zero makes things about 10% slower, but I haven't yet tried other offsets.
-
- > 3. think about cache hinting at or near the bottom of the loop.
- > if for some reason a cache line which you are going to read from
- > has been dropped, it's good to schedule its re-fetch as far ahead
- > as possible.
- A prior load loop is supposed to have ensured that the source is in the cache,
- but this is a good suggestion to double check that assumption, and probably
- the right thing to do for a general-purpose copy where cache status is
- uncontrolled. I'll check this out.
-
- > 4. I hear Exponential Technology has a faster BiCMOS 604 coming...
- That certainly does look interesting, "only" $14million capitalization, but
- good credentials. Unfortunately, I have to put something under the tree for
- this Christmas, can't wait for that rosy glow ("Is it Rudolph or is it
- bipolar?") we might see next. :-)
-
-
-
- Craig S. Steele - Not yet Institutionalized
-
-
-
- +++++++++++++++++++++++++++
-
- >From tim@apple.com (Tim Olson)
- Date: 7 Dec 1995 03:33:26 GMT
- Organization: Apple Computer, Inc. / Somerset
-
- In article <9512051830.AA53505@kandor.isi.edu>
- steele@isi.edu (Craig S. Steele) writes:
-
- > I would naively expect the copy code to average about 1.5 clocks per load or
- > store. Instead, my code reports over 4 clocks/access. The code uses the
- > time-base register for timing, which shouldn't cause significant cache
- > disturbance.
- >
- > Can anyone contradict, corroborate, or explain my poor results?
-
- I did a number of measurements awhile back which showed that a 604 can
- perform the loop you gave (without the DCBZ) at about 1.3 cycles per
- doubleword loaded or stored -- this was done by measuring the runtime
- of copying a 64-byte block over many iterations, so both source and
- destination were in the cache. The DCBZ instruction spends multiple
- cycles clearing the allocated cache block, so that will add some
- overhead (I don't have my spec with me -- I seem to remember it is 4
- cycles), which should bring it to somewhere around 15 cycles per loop
- iteration, or about 1.8 cycles per doubleword, which is still far less
- than your reported 4 cycles.
-
- First, try running without the DCBZ to see if it more closely matches
- my results (~1.3 cycles per doubleword); if not, then you might be
- forgetting about some multiplication factor when using the timebase
- register. On the 604, it increments every 4th bus clock.
-
- -- Tim Olson
- Apple Computer, Inc. / Somerset
- tim@apple.com
-
- +++++++++++++++++++++++++++
-
- >From cliffc@ami.sps.mot.com (Cliff Click)
- Date: 7 Dec 95 09:23:08
- Organization: none
-
- steele@isi.edu (Craig S. Steele) writes:
-
- Craig S. Steele <steele@isi.edu> wrote:
- >I'm trying to benchmark block copy rates of various sizes for
- >PowerPCs. My results are disappointing for the 604, and cause me
- >to wonder what it is I don't understand. Testing on a 9500/120, to
- >which I have limited access, gives the following results for copy
- >code using 32-bit integer and 64-bit double load and stores,
- >respectively:
-
- Have you tried using "lmw" and "stmw" instead of "lfd" and "stfd"?
- My 604 book sez these are #regs+2 cycles each, whilst the float
- operations are 3 cycles each. For large enough blocks, you should
- win on the lmw and stmw.
-
- Cliff
- --
- Cliff Click Compiler Researcher & Designer
- RISC Software, Motorola PowerPC Compilers
- cliffc@risc.sps.mot.com (512) 891-7240
-
- +++++++++++++++++++++++++++
-
- >From tim@apple.com (Tim Olson)
- Date: 8 Dec 1995 02:59:57 GMT
- Organization: Apple Computer, Inc. / Somerset
-
- In article <CLIFFC.95Dec7092308@ami.sps.mot.com>
- cliffc@ami.sps.mot.com (Cliff Click) writes:
-
- > Have you tried using "lmw" and "stmw" instead of "lfd" and "stfd"?
- > My 604 book sez these are #regs+2 cycles each, whilst the float
- > operations are 3 cycles each. For large enough blocks, you should
- > win on the lmw and stmw.
-
- The lfd instruction has a 3-cycle latency for using the result of the
- load in a floating-point operation, but the issue-rate of lfd is one
- per cycle. When pipelined in the manner used in the block copy code,
- it can transfer at close to one doubleword per cycle.
-
- Load and store multiple instructions can achieve close to one word per
- cycle for large transfers, but that is half the bandwith of the
- lfd/stfd solution.
-
-
- -- Tim Olson
- Apple Computer, Inc. / Somerset
- tim@apple.com
-
- +++++++++++++++++++++++++++
-
- >From Mark Williams <Mark@streetly.demon.co.uk>
- Date: Thu, 07 Dec 95 18:25:26 GMT
- Organization: Streetly Software
-
-
- In article <CLIFFC.95Dec7092308@ami.sps.mot.com>, Cliff Click writes:
-
- >
- > steele@isi.edu (Craig S. Steele) writes:
- >
- > Craig S. Steele <steele@isi.edu> wrote:
- > >I'm trying to benchmark block copy rates of various sizes for
- > >PowerPCs. My results are disappointing for the 604, and cause me
- > >to wonder what it is I don't understand. Testing on a 9500/120, to
- > >which I have limited access, gives the following results for copy
- > >code using 32-bit integer and 64-bit double load and stores,
- > >respectively:
- >
- > Have you tried using "lmw" and "stmw" instead of "lfd" and "stfd"?
- > My 604 book sez these are #regs+2 cycles each, whilst the float
- > operations are 3 cycles each. For large enough blocks, you should
- > win on the lmw and stmw.
- >
- > Cliff
- > --
- > Cliff Click Compiler Researcher & Designer
- > RISC Software, Motorola PowerPC Compilers
- > cliffc@risc.sps.mot.com (512) 891-7240
-
- But surely the point is that lfd & stfd have a _latency_ of 3 cycles, but a
- throughput of 1 instruction per cycle, whereas the lmw/stmw have both a latency
- and throughput of 1 instruction per #regs+2 cycles. That means the lfd/stfd
- method should be able to move (ie load and store) 1 word per cycle, while the
- lmw/stmw cannot do better than 1 word every 2 cycles (and even with 28 regs
- available it would take 60 cycles to move 28 words).
-
- - --------------------------------------
- Mark Williams<Mark@streetly.demon.co.uk>
-
- +++++++++++++++++++++++++++
-
- >From tjrob@bluebird.flw.att.com (Tom Roberts)
- Date: Sat, 9 Dec 1995 19:19:22 GMT
- Organization: AT&T Bell Laboratories
-
- In article <4a89nd$hrp@cerberus.ibmoto.com>, Tim Olson <tim@apple.com> wrote:
- >In article <CLIFFC.95Dec7092308@ami.sps.mot.com>
- >cliffc@ami.sps.mot.com (Cliff Click) writes:
- >
- >> Have you tried using "lmw" and "stmw" instead of "lfd" and "stfd"?
- >> My 604 book sez these are #regs+2 cycles each, whilst the float
- >> operations are 3 cycles each. For large enough blocks, you should
- >> win on the lmw and stmw.
- >
- >The lfd instruction has a 3-cycle latency for using the result of the
- >load in a floating-point operation, but the issue-rate of lfd is one
- >per cycle. When pipelined in the manner used in the block copy code,
- >it can transfer at close to one doubleword per cycle.
- >
- >Load and store multiple instructions can achieve close to one word per
- >cycle for large transfers, but that is half the bandwith of the
- >lfd/stfd solution.
-
- In practical systems, memory bandwidth is MUCH more important than
- the number of instructions used or their throughput or latency.
- (This assumes that the data actually resides in memory, not just in the
- cache. This also assumes a "long" loop, so the code is in the icache.)
-
- In systems which run the 604 at 1:1 clocking (i.e. internal CPU clock
- equals external bus clock), memory bandwidth can be 2-4 times slower than
- simple calculations. This is due to cache-access limitations and the
- fact that both the CPU and the bus access unit are competing for
- access to the cache. In this mode the memory essentially NEVER
- overlaps address and data tenures on the bus (halving memory bandwidth);
- there are usually several bus clocks between succesive cycles, reducing
- bandwidth even more.
-
- With 1.5:1 clocking this effect is reduced -- the cache can handle
- one access per internal clock, so there is a cycle available to the
- CPU between every 2 bus accesses. At 2:1 this effect should disappear,
- as the CPU can get every other cycle, and keep up with the memory
- bus bandwidth.
-
- Note that only recently have 604 chips been shipping which can go 1.5:1
- at 66 MHz bus clock.
-
- Tom Roberts tjrob@iexist.att.com
-
- ---------------------------
-
- >From ralf@lexis-nexis.com (Ralf Grisard)
- Subject: Choosing a Help Authoring Tool
- Date: 30 Nov 1995 15:31:01 GMT
- Organization: Lexis-Nexis
-
- I'm a technical writer with some experience creating electronic helps
- for MS Windows applications. I've also written balloon help and some
- technologically primitive application help for one Macintosh
- application. Now I'm researching the help possibilities for the next
- version of that Mac app. Here's a list of some of the factors I'm
- considering:
-
- * Is there a Mac help tool/system that's evolving into the "standard"?
-
- * How well is Apple Guide being accepted by the developer and user
- communities?
-
- * When will there actually be a version of Apple Guide available that
- is compatible with System 7.0/7.1?
-
- * Are there tools/systems other than Apple Guide (such as EHelp) that
- are well regarded by Mac users? For example, the help for the latest
- version of ClarisWorks for Macintosh has received some praise.
-
- * Which tools are suitable for use by non-programmers (like technical
- writers)?
-
- * What's the learning curve for the tool?
-
- * How much collaboration does a tool require between the programmer
- and the help author?
-
- * How large are the final help files? How quickly to they respond to
- the user?
-
- * How expensive is the tool? (The complete EHelp package costs about
- $2500 per copy.)
-
- * Does use of the tool involve royalty/licensing/distribution fees?
-
- And so on. Any information you could share with me would be much
- appreciated. Thanks in advance.
- --
- Ralf Grisard
- ralf@lexis-nexis.com
- LEXIS-NEXIS, Technical Communications, P.O. Box 933, Dayton, OH 45401
- voice: 513-865-7314 fax: 513-865-1655
-
-
- +++++++++++++++++++++++++++
-
- >From alain@cs.uchicago.edu (Alain Roy)
- Date: Thu, 30 Nov 1995 17:20:48 GMT
- Organization: It lurks in the night
-
- In article <49ki7n$493@meaddata.meaddata.com>, ralf@lexis-nexis.com (Ralf
- Grisard) wrote:
-
- >* When will there actually be a version of Apple Guide available that
- >is compatible with System 7.0/7.1?
-
- Apple Guide 2.0 is out and supports 7.0/7.1. Check out:
-
- http://dev.info.apple.com/appledirections/dec95/appleguide.html
-
- (They provide a pointer to download AG 2.0)
-
- Apple has "Guide Maker". I've never used it.
-
- At the info-mac archive in the "dev" directory, you can find
- "guide-composer-10-demo.hqx" which is a demo of a tool to make apple guide
- files. It claims to be easy, but I've never used it.
-
- -alain
-
- +++++++++++++++++++++++++++
-
- >From Steve@emer.com (Steve Wilson)
- Date: 30 Nov 1995 17:49:32 GMT
- Organization: Emergent Behavior
-
-
- > * How well is Apple Guide being accepted by the developer and user
- > communities?
-
- I think it is very cool. Everyone should be using it.
-
- > * When will there actually be a version of Apple Guide available that
- > is compatible with System 7.0/7.1?
-
- It is already here. You can get Appleguide 2.0 off apple's web page. It
- will work with system 7.
-
- > * Are there tools/systems other than Apple Guide (such as EHelp) that
- > are well regarded by Mac users? For example, the help for the latest
- > version of ClarisWorks for Macintosh has received some praise.
-
- I persnally hate Claris' online help. It was created with QuickView.
- QuickView was also used to create the Toolbox Assistant, which I love, so
- it probably isn't the tool's fault.
-
- > * Which tools are suitable for use by non-programmers (like technical
- > writers)?
-
- If you're going to use AppleGuide you should get Danny Goodman's book
- which includes a nice tool to get you started. It works well for
- non-programmers.
-
-
- > * How expensive is the tool? (The complete EHelp package costs about
- > $2500 per copy.)
-
- You can get the book( which includes the tool) for about $30-$40.
-
- Steve Wilson
- Emergent Behavior
- (415) 494-6763
- Steve@emer.com
-
- +++++++++++++++++++++++++++
-
- >From paquette@metrowerks.ca (Marc Paquette)
- Date: 1 Dec 1995 19:56:04 GMT
- Organization: Metrowerks Inc.
-
- In article <49kiot$493@meaddata.meaddata.com>, ralf@lexis-nexis.com (Ralf
- Grisard) wrote:
-
- Metrowerks, the company I work at, has been creeping along this path for
- some time. Here is what I have to offer. The Mac OS help jungle can be
- treacherous--watch your step:
-
- > * Is there a Mac help tool/system that's evolving into the "standard"?
-
- Balloon help. Apple Guide _could_ also be considered a "standard," but
- developers seem to be slow to accept it, although it's becoming more
- popular lately.
-
- >
- > * How well is Apple Guide being accepted by the developer and user
- > communities?
-
- See above. Metrowerks doesn't use Apple Guide so I can't give accurate
- answers about it. We don't use Apple Guide partly because the tools aren't
- quite ready yet, but mostly because our documentation is heavy on the
- technical reference side which is inappropriate for AG. However, some
- people at Apple have attentively bent theirs ears for us on making AG more
- reference-happy. The results remain to be seen.
-
- >
- > * Are there tools/systems other than Apple Guide (such as EHelp) that
- > are well regarded by Mac users? For example, the help for the latest
- > version of ClarisWorks for Macintosh has received some praise.
-
- I don't have experience in producing doc for EHelp.
-
- I'm told that Claris uses a version of QuickView for some of its software.
- So does Apple for its Toolbox Assistant software. Metrowerks is also using
- QuickView for its on-line help. QuickView is a Microsoft help-compatible
- viewer.
-
- Metrowerks also uses Adobe Acrobat, but a lot of users complain about its
- large memory footprint, its need for ATM, and incompatibilities with
- QuickDraw GX.
-
- There's also HTML. Metrowerks is looking into it, but solid HTML tools for
- the Mac aren't around yet.
-
- >
- > * Which tools are suitable for use by non-programmers (like technical
- > writers)?
-
- [rant on]
- I wish tech writers had nifty documentation development tools like
- programmers have nifty software development tools! Such tools would save
- me so much time and effort. I'd rather spend my time developing useful,
- accurate doc rather than fiddling with the silly details of how to deliver
- the doc to the user.
- [rant off]
-
- Metrowerks produces its documentation using Framemaker on Mac OS machines.
- We use whatever converters and translators there are for FrameMaker to
- convert to RTF, Acrobat, etc. It's straightforward stuff.
-
- We use Resorcerer, a resource editor, for balloon help. It's not an easy
- way to go, but we get the job done.
-
- >
- > * What's the learning curve for the tool?
-
- For FrameMaker, things are pretty simple: Create FrameMaker document,
- save/print the document in a specific format, put that file through a
- translator to generate the online help document. If you know FrameMaker,
- you've got it clinched.
-
- Resorcerer and the Help Manager's strange interactions with the Dialog
- Manager results in some frustrating situations until you get the hang of
- it.
-
- >
- > * How much collaboration does a tool require between the programmer
- > and the help author?
-
- For balloon help, the collaboration sometimes has to be pretty tight. Even
- more so, IMHO, for Apple Guide.
-
- For FrameMaker, none once you're all set up.
-
- >
- > * How large are the final help files? How quickly to they respond to
- > the user?
-
- A QV file is quite reasonable. The 1300 page PowerPlant library reference,
- produced by Metrowerks is 6.2 Mbytes. QV is responsive. We've had no
- complaints about its performance, and Altura was quick to improve parts of
- the UI at user's requests.
-
- Acrobat is about the same as a QV database. IMHO, Acrobat is OK when
- reading from a hard drive, but it can be slow when reading from a CD-ROM.
- However, proper documentation design can dramatically improve Acrobat's
- responsiveness. Metrowerks is still working on this.
-
- I don't have any numbers for the HTML version of the PowerPlant reference
- (it doesn't exist). For HTML conversion I believe we've tried some of the
- freeware/shareware translators available.
-
- >
- > * How expensive is the tool? (The complete EHelp package costs about
- > $2500 per copy.)
-
- Altura Software, Inc.
- 510 Lighthouse Ave., Suite 5
- Pacific Grove, CA 93950
-
- Voice:408.655.8005
- FAX:408.655.9663
-
- Disclaimer: Some of these opinions are my own, not Metrowerks. All of
- these opinions are based on my experiences as a member of the Metrowerks
- documentation team.
-
- Regards,
-
- Marc.
-
- - -
- Marc Paquette
- Lead Lead Pipe Fitter
- Metrowerks Inc.
-
- +++++++++++++++++++++++++++
-
- >From Jeff Benjamin <stepup@onramp.net>
- Date: 1 Dec 1995 15:54:16 GMT
- Organization: StepUp Software
-
- ralf@lexis-nexis.com (Ralf Grisard) wrote:
-
- >
- >* Is there a Mac help tool/system that's evolving into the "standard"?
- >
-
- Only time will tell. It seems that Apple Guide is growing
- very well.
-
- >
- >* When will there actually be a version of Apple Guide available that
- >is compatible with System 7.0/7.1?
-
- Today. Apple Guide 2.0 (shipping).
-
-
- >* Which tools are suitable for use by non-programmers (like technical
- >writers)? * What's the learning curve for the tool?
- >
-
- I suggest you check out our Guide Composer (see Web site below).
-
- >* How much collaboration does a tool require between the programmer
- >and the help author?
-
- It depends on the level of interaction between the help system and
- the program. For Apple Guide, it could be as little as NO
- INTERACTION. If your app is AppleScript-able, you can do alot
- w/o the programmer.
-
- >
- >* How expensive is the tool? (The complete EHelp package costs about
- >$2500 per copy.)
-
- Guide Composer is $99. No other fees.
-
- >* Does use of the tool involve royalty/licensing/distribution fees?
-
- For Guide Composer, no.
-
- Good luck!
-
-
- - -----------------------------------------------
- + Jeff Benjamin
- + StepUp Software
- + stepup@onramp.net
- + http://rampages.onramp.net/~stepup/
- - -----------------------------------------------
-
-
-
- +++++++++++++++++++++++++++
-
- >From billf@scruznet.com (Bill Foster)
- Date: Mon, 04 Dec 1995 21:32:34 -0800
- Organization: Passion Pacific
-
- In article <49kinl$493@meaddata.meaddata.com>, ralf@lexis-nexis.com (Ralf
- Grisard) wrote:
-
- > Now I'm researching the help possibilities for the next
- > version of that Mac app.
- >
- > And so on. Any information you could share with me would be much
- > appreciated. Thanks in advance.
- > --
- > Ralf Grisard
- > ralf@lexis-nexis.com
- > LEXIS-NEXIS, Technical Communications, P.O. Box 933, Dayton, OH 45401
- > voice: 513-865-7314 fax: 513-865-1655
-
- You might want to check out
-
- http://www.guideworks.com
-
- This site has a lot of information about Apple Guide.
-
- Apple Guide 2.0 now supports System 7.0/7.1. It is available from the
- guideWorks site as is the GuideMaker application for compiling guides. I'm
- not sure about licensing but its either free or cheap.
-
- It's pretty easy to put together a basic guide. You do not need to change
- your application unless you want to add features.
-
- ================================================
- Bill Foster Passion Pacific Solutions
- billf@scruznet.com Santa Cruz, Califonia
- ================================================
-
- +++++++++++++++++++++++++++
-
- >From alspaugh@showme.missouri.edu (Bruce Alspaugh)
- Date: Thu, 07 Dec 1995 14:25:35 -0600
- Organization: SchoolWare
-
- In article <49ki7n$493@meaddata.meaddata.com>, ralf@lexis-nexis.com (Ralf
- Grisard) wrote:
-
- > * When will there actually be a version of Apple Guide available that
- > is compatible with System 7.0/7.1?
-
- AppleGuide 2.0, which supports system 7.0 and 7.1, is available now and
- can be ftp'ed from:
-
- ftp://ftp.info.apple.com/Apple.Support.Area/Developer_Services/System_Software_Extensions/Apple_Guide_Authoring_Kit.
-
-
- If you want further information on AppleGuide, I suggest you check out the
- GuideWorks home page:
-
- http://www.guideworks.com/
-
- You can also subscribe to an apple-guide mailing list to answer your
- technical questions. Send an e-mail to listserv@list.peter.com.au with
- the command, subscribe apple-guide <your first name> <your last name> in
- the subject header and the body of the message.
-
- Hope this helps,
-
-
- Bruce Alspaugh
- alspaugh@showme.missouri.edu
-
- +++++++++++++++++++++++++++
-
- >From ldo@waikato.ac.nz (Lawrence D'Oliveiro)
- Date: Fri, 08 Dec 1995 17:42:09 +1300
- Organization: University of Waikato
-
- In article <paquette-0112951500140001@sigma.metrowerks.ca>,
- paquette@metrowerks.ca (Marc Paquette) wrote:
-
- >Metrowerks also uses Adobe Acrobat, but a lot of users complain about its
- >large memory footprint, its need for ATM, and incompatibilities with
- >QuickDraw GX.
-
- I believe Adobe's PDF-generation tools are GX-incompatible, however
- Acrobat Reader 2.1 seems to work OK (most of the time) with GX.
-
- Under GX, as you know, you can print from any application to a "Portable
- Digital Document" (PDD). This is viewable and printable at full resolution
- on any printer from any Mac with GX installed. I've also been working on a
- tool to generate PDF files from these PDDs--no support for hyperlinks and
- annotations as yet, though. If anybody's interested, they can try out a
- prerelease version at
- <ftp://sumex-aim.stanford.edu/info-mac/gst/grf/tumbler-06d2.hqx>. Feel
- free to send me your comments.
-
- Lawrence
- supporter of the QuickDraw GX Fan Club at <http://www.ixmedia.com/quickgx/>
-
- ---------------------------
-
- >From Frank Kane <fkane@tiac.net>
- Subject: Events vs. GetKeys
- Date: Sat, 02 Dec 1995 14:54:14 +0000
- Organization: Cerberus Development
-
- I hear mixed messages about using GetKeys() vs. the Event Manager to
- read user input during a game.
-
- I used GetKeys in my first game, and I'm using events in my current
- game. Honestly, I don't think it makes much of a difference in
- terms of speed.
-
- Using the Event Manager has several advantages, such as ensuring
- that you don't miss a keystroke if the user hits a key real fast
- (it's also a heckuva lot easier.) It just seems safer, and more
- friendly to the customer. Plus it seems like a safer bet that
- future game controllers will work properly through the event queue.
-
- Am I missing the boat altogether by using the Event Manager? Is
- there some good reason to use GetKeys that I don't know about?
-
- Thanks,
- -Frank Kane
- Cerberus Development
- http://www.transy.edu/~cerbdev/Mac_Division/MacHome.html
-
- +++++++++++++++++++++++++++
-
- >From kbs3387@silver.sdsmt.edu (Kevin Stone)
- Date: 2 Dec 1995 21:00:05 GMT
- Organization: South Dakota School of Mines and Technology
-
- : Am I missing the boat altogether by using the Event Manager? Is
- : there some good reason to use GetKeys that I don't know about?
-
- Can you read multiple keys this way?
- My understanding is that when an event is triggered, it's sent to the
- Event Manager queue. It waits their until you use GetNextEvent or
- WaitNextEvent. You can see what the next event is... whether it's a
- key hit or a mouse click or whatever, and you can check to see which
- modifier keys are down, but it dosn't look like you can't see if two
- character keys are down at the same time.
-
- I don't know... I might be missing something here. Personaly, I
- havn't had any problems with GetKeys.
-
- BAS
-
-
- +++++++++++++++++++++++++++
-
- >From lewistotle@emf.net (John Lewis)
- Date: Sat, 02 Dec 1995 14:02:16 -0800
- Organization: me
-
- In article <30C06896.8A5@tiac.net>, fkane@tiac.net wrote:
-
- > Using the Event Manager has several advantages, such as ensuring
- > that you don't miss a keystroke if the user hits a key real fast
- > (it's also a heckuva lot easier.) It just seems safer, and more
- > friendly to the customer. Plus it seems like a safer bet that
- > future game controllers will work properly through the event queue.
- >
- > Am I missing the boat altogether by using the Event Manager? Is
- > there some good reason to use GetKeys that I don't know about?
-
- I'm currently working on a project that needs to know when the user
- releases a key as well. I started out using the event manager and watching
- for keyUp events. (Yes I did call SetEventMask)
-
- This worked fine except when I was running under the debugger. Then, for a
- reason I still haven't figured out, I wouldn't receive keyUp events. For
- this reason, I ended up switching to GetKeys.
-
- The keyUp problem wouldn't happen all the time, though, and Metrowerks has
- been notified of the problem.
-
- Later.
-
- - ------------------------------------------------------------------------
- John "I'd rather be skydiving" Lewis |#include "stdsig.BS" | This space |
- lewistotle@emf.net <- prefered |Blue Skies | available |
- lewistotle@maxis.com work(unreliable)|USPA87419, C-22826 | for rent. |
- lewistotle@aol.com <- rarely |Slider - '92 BMW K75s| Inquire |
- |http://www.emf.net/~lewistot |<fnord> | within |
-
- +++++++++++++++++++++++++++
-
- >From Frank Kane <fkane@tiac.net>
- Date: Sun, 03 Dec 1995 09:38:16 +0000
- Organization: Cerberus Development
-
- > The keyUp problem wouldn't happen all the time, though, and Metrowerks has
- > been notified of the problem.
- >
-
- Glad you posted this... I've been having the same problems with KeyUps as
- well, but I thought it was some horribly elusive bug in my code. Now at least
- I know I'm not to blame...
-
- Regarding the previous post -- yes, you can tell if two keys are down
- simultaneously using events, *if* you track KeyUps as well as KeyDowns. Just
- don't try it using the MW debugger :-)
-
- Thanks,
- -Frank
-
- +++++++++++++++++++++++++++
-
- >From tgooding@iastate.edu (Tom Gooding)
- Date: Sun, 03 Dec 1995 20:46:47 -0600
- Organization: Iowa State University, Ames, Iowa
-
- In article <30C06896.8A5@tiac.net>, fkane@tiac.net wrote:
-
- > I hear mixed messages about using GetKeys() vs. the Event Manager to
- > read user input during a game.
- >
- > I used GetKeys in my first game, and I'm using events in my current
- > game. Honestly, I don't think it makes much of a difference in
- > terms of speed.
- >
- > Using the Event Manager has several advantages, such as ensuring
- > that you don't miss a keystroke if the user hits a key real fast
- > (it's also a heckuva lot easier.) It just seems safer, and more
- > friendly to the customer. Plus it seems like a safer bet that
- > future game controllers will work properly through the event queue.
- >
- > Am I missing the boat altogether by using the Event Manager? Is
- > there some good reason to use GetKeys that I don't know about?
-
- My experience using the Event Manager has been somewhat rocky. It has a
- few problems.
- 1) Reading Multiple keys becomes difficult
- 2) The speed that you can read keys is limited by the keyboard repeat rate.
-
- I dunno, maybe I'm missing some function call. If speed isn't important,
- use GetNextEvent or WaitNextEvent.
-
- Tom Gooding
- tgooding@iastate.edu
- Computer Engineering 4
-
- +++++++++++++++++++++++++++
-
- >From ingemar@lysator.liu.se (Ingemar Ragnemalm)
- Date: 4 Dec 1995 09:34:14 GMT
- Organization: (none)
-
- Frank Kane <fkane@tiac.net> writes:
-
- >I hear mixed messages about using GetKeys() vs. the Event Manager to
- >read user input during a game.
- Of course you get mixed messages! Different games need different solutions.
-
- >I used GetKeys in my first game, and I'm using events in my current
- >game. Honestly, I don't think it makes much of a difference in
- >terms of speed.
-
- It makes a big difference if you use WNE with a sleep time > 0, or have
- lots of applications in the background.
-
- >Using the Event Manager has several advantages, such as ensuring
- >that you don't miss a keystroke if the user hits a key real fast
- >(it's also a heckuva lot easier.) It just seems safer, and more
- >friendly to the customer. Plus it seems like a safer bet that
- >future game controllers will work properly through the event queue.
-
- Also, with events you *know* what key the user has hit. With GetKeys,
- you only have the key code, you don't know what key it is. Assuming that
- the key codes are the same on all keyboards is foolish. Dark Forces
- does it, but that's no excuse. (The "+" key shinks the map and the "'"
- key expands it - not good at all!)
-
- >Am I missing the boat altogether by using the Event Manager? Is
- >there some good reason to use GetKeys that I don't know about?
-
- Well, as long as you just want the keyDowns, that is, if you just want to
- know when a key is hit, not for how long it stays down, it is ok. I never
- felt I could trust every keyDown to be matched by a keyUp.
-
- --
- - -
- Ingemar Ragnemalm, PhD
- Image processing, Mac shareware games
- E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se
-
- +++++++++++++++++++++++++++
-
- >From jmunkki@gamma.hut.fi (Juri Munkki)
- Date: 4 Dec 1995 17:12:32 GMT
- Organization: Helsinki University of Technology
-
- In article <49ufan$kgj@newsy.ifm.liu.se> ingemar@lysator.liu.se (Ingemar Ragnemalm) writes:
- >Frank Kane <fkane@tiac.net> writes:
- >>I used GetKeys in my first game, and I'm using events in my current
- >>game. Honestly, I don't think it makes much of a difference in
- >>terms of speed.
-
- >It makes a big difference if you use WNE with a sleep time > 0, or have
- >lots of applications in the background.
-
- During games, I never call WNE. I may call GetNextEvent, if the user
- has background processing enabled, but the best thing is usually to
- call only GetOSEvent, since it doesn't allow any background processing.
-
- >>Using the Event Manager has several advantages, such as ensuring
- >>that you don't miss a keystroke if the user hits a key real fast
- >>(it's also a heckuva lot easier.) It just seems safer, and more
- >>friendly to the customer. Plus it seems like a safer bet that
- >>future game controllers will work properly through the event queue.
-
- These are all true. That's why I converted from GetKeys to GetOSEvent.
- The main bother is that you don't get keyUps and keyDowns for modifier
- keys and they are usually the best for games, so one has to write some
- additional code to handle them and it's still possible for the game to
- miss a quick tap on a modifier key.
-
- >Also, with events you *know* what key the user has hit. With GetKeys,
- >you only have the key code, you don't know what key it is. Assuming that
- >the key codes are the same on all keyboards is foolish. Dark Forces
- >does it, but that's no excuse. (The "+" key shinks the map and the "'"
- >key expands it - not good at all!)
-
- Keys should be configurable. I think it is better to attach the functions
- to virtual keycodes than characters. You just have to remember that the
- layouts may change and some keys may not exist at all or some extra keys
- will exist on some keyboards.
-
- I believe that I have the perfect solution to keyboard configuration,
- but most of you will have to wait until the game is released before you
- can judge if it does it right. It's a very compact, easily
- reconfigurable library, so I may offer it to other developers as well,
- if there is interest.
-
- >Well, as long as you just want the keyDowns, that is, if you just want to
- >know when a key is hit, not for how long it stays down, it is ok. I never
- >felt I could trust every keyDown to be matched by a keyUp.
-
- Interestingly, it seems you can trust keyUps to be posted for each
- keyDown. At least it works for me. You can also get more accurate
- timing information with events, since every event is time stamped
- with a tickcount.
-
- The thing to remember with events is that you only get one event at a time
- even when there might be a dozen queued up. Each time you look for keyboard
- activity, go through the whole queue. A game that only allows one keypress
- per frame will be extremely irritating to most players.
-
- --
- Juri Munkki jmunkki@iki.fi In cyberspace everyone can hear you scream.
- http://www.iki.fi/~jmunkki Windsurfing: Faster than the wind.
-
- +++++++++++++++++++++++++++
-
- >From jesjones@halcyon.com (Jesse Jones)
- Date: 4 Dec 1995 01:28:06 GMT
- Organization: Edmark
-
- In article <lewistotle-0212951402160001@emf2-212.emf.net>,
- lewistotle@emf.net (John Lewis) wrote:
-
- [snip]
-
- > I'm currently working on a project that needs to know when the user
- > releases a key as well. I started out using the event manager and watching
- > for keyUp events. (Yes I did call SetEventMask)
- >
- > This worked fine except when I was running under the debugger. Then, for a
- > reason I still haven't figured out, I wouldn't receive keyUp events. For
- > this reason, I ended up switching to GetKeys.
-
- [snip]
-
- For some reason the system event mask isn't reset when apps are switched
- out and in. You need to reset the mask when your app is switched in and
- change it back to the default before quitting.
-
- --Jesse
-
- +++++++++++++++++++++++++++
-
- >From hnsngr@sirius.com (Ron Hunsinger)
- Date: Mon, 04 Dec 1995 20:59:55 -0800
- Organization: ErsteSoft
-
- In article <tgooding-0312952046470001@helser196.res.iastate.edu>,
- tgooding@iastate.edu (Tom Gooding) wrote:
-
- > In article <30C06896.8A5@tiac.net>, fkane@tiac.net wrote:
- >
- > > Using the Event Manager has several advantages, such as ensuring
- > > that you don't miss a keystroke if the user hits a key real fast
- > > (it's also a heckuva lot easier.) It just seems safer, and more
- > > friendly to the customer.
-
- Hear, hear! I really hate games that miss keystrokes because they're using
- GetKeys. And from a progamming viewpoint, I agree that events are a lot
- cleaner.
-
- One advantage you overlooked is that the Event Manager understands about
- multiple keyboards. Admittedly, not many users have them, but the fact
- that GetKeys is making an unwarranted assumption strengthens the feeling
- that it's really just a kludge.
-
- > My experience using the Event Manager has been somewhat rocky. It has a
- > few problems.
- > 1) Reading Multiple keys becomes difficult
-
- Not really. Enable keyUp events (and mask out autoKey events instead), and
- you will get exactly the same information: a keyDown every time a bit is
- set in the keyboard table, and a keyUp every time a bit is cleared. Except
- for modifier keys, of course, which you have to track separately from the
- modifiers field of each event.
-
- > 2) The speed that you can read keys is limited by the keyboard repeat rate.
-
- No difference here. The information returned by GetKeys only changes this
- fast anyway. The keyboard itself only sends back (the equivalent of)
- keyDown and keyUp events, which the event manager uses to maintain the
- table that GetKeys returns.
-
- You can maintain that table just as well, and if you do it yourself you're
- sure to catch rapid keystrokes.
-
- > I dunno, maybe I'm missing some function call. If speed isn't important,
- > use GetNextEvent or WaitNextEvent.
-
- I can't believe that speed would ever be that important. The keyboard is
- only scanned 60 times a second, and the cost of GetNextEvent is much
- smaller than this.
-
- If absolutely necessary, you can monitor Ticks so you only call GNE/WNE
- that often. The test would be: don't call GNE if the last event was a
- nullEvt and the TickCount hasn't changed since then. This allows for the
- possibility that multiple events could be posted in one tick, while still
- holding the overhead down to at most one superflous call per tick.
-
- -Ron Hunsinger
-
- +++++++++++++++++++++++++++
-
- >From johnb@hk.super.net (John W. Blackburne)
- Date: Tue, 05 Dec 1995 18:11:57 +0800
- Organization: Tempest
-
- Not so much a reply but a couple of observations.
-
- First is that one problem with events is as far as I can tell you won't
- receive notification of a user pressing a modifier key. With most
- keyboards having dozens of other keys to choose from this would not be
- important, except Apple only guarantees that at at most 2 non-modifier
- keys will be properly sensed at once. Modern action games can easily have
- four or five keys in use at once, so function most reliably using
- modifiers for many of their functions.
-
- This is assuming the 'at most 2 keys plus modifiers' limit still applies.
- I think this first appeared in Inside Macintosh IV or V, and I've not seen
- anything about it since then. We've been through a few System software and
- hardware revisions since then, so does this limit still apply ?
-
- Also the most significant problem with GetKeys, that it can't poll
- multiple devices, e.g. a keyboard and seperate keypad, can be fixed using
- a GetKeys replacement routine, ADB Key Spy, which appeared on the November
- Developer CD.
-
- John
- --
- John Blackburne, johnb@tempest.net.hk
- Programmer Asia, Inc. Online: http://www.asia-inc.com
- Technology consultant and trainer: http://www.hk.super.net/~johnb
-
- +++++++++++++++++++++++++++
-
- >From pottier@brick.ens.fr (Francois Pottier)
- Date: 5 Dec 1995 15:06:29 GMT
- Organization: Ecole Normale Superieure, Paris
-
- In article <49va60$v7l@nntp.hut.fi>, Juri Munkki <jmunkki@gamma.hut.fi> wrote:
-
- >Keys should be configurable. I think it is better to attach the functions
- >to virtual keycodes than characters.
-
- I agree, because people with foreign keyboards will have trouble if functions
- are attached to characters which are obtained through weird combinations. The
- only problem is then how to tell the user which key does which. For instance,
- the docs for A-10 say "press M to arm the cannon" but I actually have to press
- "," because I have a French keyboard. The location of the key on the keyboard
- is the same, but a user who has never used an American keyboard is helplessly
- lost.
-
- --
- Francois
- pottier@dmi.ens.fr
- http://www.eleves.ens.fr:8080/home/pottier/
-
- +++++++++++++++++++++++++++
-
- >From jmunkki@gamma.hut.fi (Juri Munkki)
- Date: 5 Dec 1995 20:13:08 GMT
- Organization: Helsinki University of Technology
-
- In article <4a1n5l$p2l@nef.ens.fr> pottier@brick.ens.fr (Francois Pottier) writes:
- >In article <49va60$v7l@nntp.hut.fi>, Juri Munkki <jmunkki@gamma.hut.fi> wrote:
- >
- >>Keys should be configurable. I think it is better to attach the functions
- >>to virtual keycodes than characters.
- >
- >I agree, because people with foreign keyboards will have trouble if functions
- >are attached to characters which are obtained through weird combinations. The
- >only problem is then how to tell the user which key does which. For instance,
- >the docs for A-10 say "press M to arm the cannon" but I actually have to press
- >"," because I have a French keyboard. The location of the key on the keyboard
- >is the same, but a user who has never used an American keyboard is helplessly
- >lost.
-
- You can use KeyTrans to translate key codes to characters. Optimally you
- would maintain a set of strings or icons to label special keys that do not
- have printable characters (like tab, return, F1-F15, home, arrow keys) and
- you can use KeyTrans for the other keys.
-
- If, in addition to this, you show the user a picture of the keyboard he/she
- is typing on with the keys clearly shown, you should be able to avoid all
- confusion. (But then you have to remember that there can be multiple different
- keyboards attached.)
-
- --
- Juri Munkki jmunkki@iki.fi In cyberspace everyone can hear you scream.
- http://www.iki.fi/~jmunkki Windsurfing: Faster than the wind.
-
- +++++++++++++++++++++++++++
-
- >From jmunkki@gamma.hut.fi (Juri Munkki)
- Date: 5 Dec 1995 21:25:09 GMT
- Organization: Helsinki University of Technology
-
- In article <johnb-0512951811570001@slip202.hk.super.net> johnb@hk.super.net (John W. Blackburne) writes:
- >First is that one problem with events is as far as I can tell you won't
- >receive notification of a user pressing a modifier key. With most
- >keyboards having dozens of other keys to choose from this would not be
- >important, except Apple only guarantees that at at most 2 non-modifier
- >keys will be properly sensed at once. Modern action games can easily have
- >four or five keys in use at once, so function most reliably using
- >modifiers for many of their functions.
-
- Events win over GetKeys here too. The very least you will get is a
- null event with the modifier keys bitmap. If the user happened to
- release or press any other keys, those events will also have modifier
- key bitmaps, so you actually get the state of modifier keys whenever
- something else happens on the keyboard, whereas with GetKeys, you only
- get the current situation.
-
- The only thing you can't (as far as I know) do with events is to detect
- the right side command, shift and option (ALT) keys on the extended
- keyboard. (And tell them apart from the left side.)
-
- >This is assuming the 'at most 2 keys plus modifiers' limit still applies.
- >I think this first appeared in Inside Macintosh IV or V, and I've not seen
- >anything about it since then. We've been through a few System software and
- >hardware revisions since then, so does this limit still apply ?
-
- It has nothing to do with system software. It's a hardware limitation
- related to the way the keyboard matrix is designed. The limitation was
- slightly relaxed on some keyboards (the Apple Extended Keyboard comes
- to mind but there are still severe limitations to the number of
- keydowns that can be detected.
-
- An easy way to find them is to open Key Caps and play with holding
- multiple keys: you'll see the ones that are detected highlited.
-
- The two key limitation is still the lowest common denominator, so it is
- a good idea to test default key layouts on such a keyboard.
-
- --
- Juri Munkki jmunkki@iki.fi In cyberspace everyone can hear you scream.
- http://www.iki.fi/~jmunkki Windsurfing: Faster than the wind.
-
- +++++++++++++++++++++++++++
-
- >From gordon@micron.net (Gordon Henriksen)
- Date: 6 Dec 1995 00:38:10 GMT
- Organization: Micron Internet Services
-
- Okay, it seems to me that most people have decided to go with the Event
- Manager to track keys. I only have one problem with this: How does one
- track modifier keys this way? Most programs don't need it, but games ARE
- the exception of most every rule. Anyway....
-
- TTFN,
- Gordon Henriksen
- gordon@micron.net
- __________________________________________________
- HAL 9000: Dave. Put down those Windows disks, Dave. DAVE!
- __________________________________________________________________
- Microsoft is prohibited from redistributing this work in any form,
- in whole or in part. Copyright, Gordon Henriksen, 1995. License to
- distribute this post is available to Microsoft for $150. Posting
- without permission constitutes an agreement to these terms. Please
- send notices of violation to gordon@micron.net and
- Postmaster@microsoft.com
-
- +++++++++++++++++++++++++++
-
- >From hnsngr@sirius.com (Ron Hunsinger)
- Date: Tue, 05 Dec 1995 20:31:45 -0800
- Organization: ErsteSoft
-
- In article <jesjones-0312951724490001@blv-pm10-ip16.halcyon.com>,
- jesjones@halcyon.com (Jesse Jones) wrote:
-
- > In article <lewistotle-0212951402160001@emf2-212.emf.net>,
- > lewistotle@emf.net (John Lewis) wrote:
- >
- > [snip]
- >
- > > I'm currently working on a project that needs to know when the user
- > > releases a key as well. I started out using the event manager and watching
- > > for keyUp events. (Yes I did call SetEventMask)
- > >
- > > This worked fine except when I was running under the debugger. Then, for a
- > > reason I still haven't figured out, I wouldn't receive keyUp events. For
- > > this reason, I ended up switching to GetKeys.
- >
- > [snip]
- >
- > For some reason the system event mask isn't reset when apps are switched
- > out and in. You need to reset the mask when your app is switched in and
- > change it back to the default before quitting.
-
- Not so. The system event mask is maintained separately for each process,
- and is switched properly whenever there is a process switch. You can set
- it once during initialization and forget about it. Your setting is in
- effect whenever (and only when) your application is the front process.
-
- The only thing you have to worry about is keystrokes that are sent to
- another process while you're in the background. To compensate, you need to
- adjust your private key map each time you get a resume event. You can
- either rebuild it using GetKeys (being careful to handle foreign keyboards
- properly), or just flush all keyboard events and presume that all the keys
- are up.
-
- This came up once before in another conference, and I conducted a lengthy
- conversation with the person who reported (as you did) that it doesn't
- work. We finally pinned it down to his debugger. I was using MacsBug,
- which shows what's actually going on. He was using the debugger integrated
- into his development system (Symantec C, IIRC).
-
- The problem boils down to the fact that, while you are debugging with a
- high level debugger, your active process is actually the debugger rather
- than the program under test, so PostEvent uses the SysEvtMask for the
- debugger instead of the one set by SetEventMask in the application. To add
- to the confusion, if you ask the debugger to display (or set) low memory,
- it may show you the application's low memory instead of its own.
-
- He found a workaround. I'm not 100% sure what it was, but I presume it was
- to set SysEvtMask (at address $0144) for the debugger as well as for the
- application. It's also possible that he got around the problem by
- debugging with MacsBug instead of the integrated debugger. Kind of a
- nuisance, I suppose, but your customers aren't going to be debugging the
- final product, so it's only a nuisance to you, not them.
-
- -Ron Hunsinger
-
- +++++++++++++++++++++++++++
-
- >From jmunkki@gamma.hut.fi (Juri Munkki)
- Date: 6 Dec 1995 09:17:15 GMT
- Organization: Helsinki University of Technology
-
- In article <gordon-0512951741350001@cs001p06.ket.micron.net> gordon@micron.net (Gordon Henriksen) writes:
- >Okay, it seems to me that most people have decided to go with the Event
- >Manager to track keys. I only have one problem with this: How does one
- >track modifier keys this way? Most programs don't need it, but games ARE
- >the exception of most every rule. Anyway....
-
- The event record has the modifiers field that you can use. That's easy
- enough. The tricky thing is to detect dead keys. I forgot all about that
- until I tried to use a dead key in my app...it only worked every second
- time, since the first time was "dead".
-
- Any suggestions as to how to handle dead keys without GetKeys or
- an equivalent would be welcome. In my case, I would also prefer to
- be able to use the dead keys to accent marks while the game is running,
- so making them act like regular keys would not be the perfect solution.
-
- It's back to the drawing board for me... ouch.
-
- --
- Juri Munkki jmunkki@iki.fi In cyberspace everyone can hear you scream.
- http://www.iki.fi/~jmunkki Windsurfing: Faster than the wind.
-
- +++++++++++++++++++++++++++
-
- >From reed@medicine.wustl.edu (Thomas Reed)
- Date: Wed, 06 Dec 1995 09:44:19 -0600
- Organization: Washington University
-
- >First is that one problem with events is as far as I can tell you won't
- >receive notification of a user pressing a modifier key.
-
- Yeah, but every event has got bits telling what modifiers were down at the
- time. You can always do something like scan for nullEvents and check the
- modifiers in the event. The system always has nullEvents to spare, so
- you'll never go looking for one and come up dry...
-
- -Thomas
-
- =====================================================
- Thomas Reed Washington University
- reed@visar.wustl.edu Medical School
- reed@medicine.wustl.edu Saint Louis, MO
- http://medinfo.wustl.edu/~reed
- - ---------------------------------------------------
- Clothes make the man. Naked people have little or no
- influence on society. -- Mark Twain
- =====================================================
-
- Opinions posted are not the opinions of Wash. U.
-
- +++++++++++++++++++++++++++
-
- >From Frank Kane <fkane@tiac.net>
- Date: Wed, 06 Dec 1995 19:30:50 -0500
- Organization: Cerberus Development
-
- Juri Munkki wrote:
-
- > The event record has the modifiers field that you can use. That's easy
- > enough. The tricky thing is to detect dead keys. I forgot all about that
- > until I tried to use a dead key in my app...it only worked every second
- > time, since the first time was "dead".
-
- I'm not 100% sure what you mean by a "dead key." Could you explain the problem
- you're having a bit more? Are we talking about a bit too much dried coffee
- sitting in a contact for a key, or some quirky event manager thing related to
- handling more than two non-modifier keys being depressed simultaneously?
-
- This makes me think:
-
- If a user depresses and holds 'A', 'S' and 'D', in that order, I expect that
- we'll get KeyDowns for A and S but not D. Now, if the user releases these keys
- in the opposite order, do we get a KeyUp for D with no matching KeyDown?
-
- -Frank
-
- +++++++++++++++++++++++++++
-
- >From hnsngr@sirius.com (Ron Hunsinger)
- Date: Thu, 07 Dec 1995 03:18:24 -0800
- Organization: ErsteSoft
-
- In article <johnb-0512951811570001@slip202.hk.super.net>,
- johnb@hk.super.net (John W. Blackburne) wrote:
-
- > Not so much a reply but a couple of observations.
- >
- > First is that one problem with events is as far as I can tell you won't
- > receive notification of a user pressing a modifier key.
-
- Sure you do. You don't even have to keep track of them. The modifier keys
- each have their own bit in the modifiers field of the Event Record. These
- are valid for every event type, even nullEvt.
-
- > With most
- > keyboards having dozens of other keys to choose from this would not be
- > important, except Apple only guarantees that at at most 2 non-modifier
- > keys will be properly sensed at once.
-
- This is a limitation of the keyboard, not the OS. When you press the third
- non-modifier key on a 'standard' Apple keyboard, the keyboard itself sends
- a keyUp for the first key in response to the next poll.
-
- Since it's the keyboard doing this, the limit of two non-modifier keys
- applies no matter how you examine the results, whether with events or with
- GetKeys.
-
- The separate numeric keypad was non-standard in this regard, and would
- report all the keys.
-
- I'm pretty sure the extended keyboards treat the numeric keypad part the
- same way. That is, it's only on the main block of keys that rollover is
- limited to two keys. The definitive answer, as ever, is keyboard
- dependent.
-
- -Ron Hunsinger
-
- +++++++++++++++++++++++++++
-
- >From thebug@berlin.snafu.de (TheBug)
- Date: Thu, 07 Dec 1995 14:05:46 +0100
- Organization: privat
-
- In article <30C635BA.203C@tiac.net>, fkane@phcteam.com wrote:
-
- > I'm not 100% sure what you mean by a "dead key." Could you explain the
- problem
- > you're having a bit more?
-
- Dead keys generate no KeyDown event on the first pressing down, like the
- accent character key. Since these keys can be on different locations in
- different quantities, depending on the language being used this is a BIG
- problem.
-
- > If a user depresses and holds 'A', 'S' and 'D', in that order, I expect that
- > we'll get KeyDowns for A and S but not D. Now, if the user releases
- these keys
- > in the opposite order, do we get a KeyUp for D with no matching KeyDown?
-
- You will never see a KeyUp for which there was no KeyDown. What I wuld
- guess in your case is that you can get an additional KeyDown for a key
- that is not acutally pressed. This is due to the fact the keyboards are
- arranged in matrixes. If you press three keys in a certain pattern in the
- matrix you will see another key as being pressed, even though it actually
- is'nt. To prevent this you would have to put diodes all over the matrix.
- Due to production cost this is almost never done.
-
- --
- *******************************************************************
- Guido Körber - Programmer and hardware hacker
- thebug@berlin.snafu.de Specialised in mistreating the ADB
- fax: x49-30-773 81 36 Ask me about:
- Flightstick Pro, Jetstick
- MacEnjoy, MacEnjoy Style
-
- Opinions expressed herein are mine unless expressly stated
- otherwise. Similarities with living or undead persons are
- coincidence and not intended - really! ;-)
- Best use before: (see date printed on backside of message)
- *******************************************************************
-
- +++++++++++++++++++++++++++
-
- >From jmunkki@gamma.hut.fi (Juri Munkki)
- Date: 7 Dec 1995 21:51:05 GMT
- Organization: Helsinki University of Technology
-
- In article <30C635BA.203C@tiac.net> fkane@phcteam.com writes:
- >Juri Munkki wrote:
- >> The event record has the modifiers field that you can use. That's easy
- >> enough. The tricky thing is to detect dead keys. I forgot all about that
- >> until I tried to use a dead key in my app...it only worked every second
- >> time, since the first time was "dead".
- >
- >I'm not 100% sure what you mean by a "dead key." Could you explain the problem
-
- Look up the words "dead key" in Inside Macintosh. They are usually used to
- provide accented characters. When you hit the accent mark key, no keyDown
- is reported. If you then hit a character that can not accept an accent,
- the dead key (a backquote, for instance) keyDown is queued as well as
- the character that could not be accented.
-
- There's a funny feature related to that too. The keyDown event for the
- dead key receives it's modifier keys from the next key, so:
-
- if you try to enter ~ ctrl-Z to suspend an rlogin:
-
- - the ~ is a dead key (on at least some KCHRs), so it doesn't cause
- a keyDown.
- - The ctrl-Z is entered and obviously a control character can not
- take the accent, but instead of ~ctrl-Z, we actually get ctrl-~
- ctrl-Z, because the modifier keys from the ctrl-Z are copied to
- the dead key.
-
- It was a major problem for me, back when I was writing a terminal program
- that ran on a keyboard with no control key. The command key could be used
- as the control key, so pressing ~ command-Z actually cause ctrl-~ ctrl-Z
- to be sent. It doesn't have much relevance to games though.
-
- >you're having a bit more? Are we talking about a bit too much dried coffee
- >sitting in a contact for a key, or some quirky event manager thing related to
- >handling more than two non-modifier keys being depressed simultaneously?
-
- I usually wash my keyboard when I spill Coca Cola on it.
-
- >If a user depresses and holds 'A', 'S' and 'D', in that order, I expect that
- >we'll get KeyDowns for A and S but not D. Now, if the user releases these keys
- >in the opposite order, do we get a KeyUp for D with no matching KeyDown?
-
- You can only get keyUps for keys that have gotten keyDowns. Every keyUp is
- preceded by a keyDown. If you hold down 456 and then release 4, you will get
- a keyUp for 4 and then immediately a keyDown for 6.
-
- As I remember it, the limitations of the extended keyboard are really
- funky... you can hold down certain combinations of keys, but not others.
- Key Caps is again your friend in exploring these mysteries.
-
- --
- Juri Munkki jmunkki@iki.fi In cyberspace everyone can hear you scream.
- http://www.iki.fi/~jmunkki Windsurfing: Faster than the wind.
-
- +++++++++++++++++++++++++++
-
- >From dsemchi@glenayre.com (Dale Semchishen [4597])
- Date: Wed, 6 Dec 1995 20:45:59 GMT
- Organization: Glenayre Electronics Ltd.
-
- In article 0512951811570001@slip202.hk.super.net, johnb@hk.super.net (John W. Blackburne) writes:
- >This is assuming the 'at most 2 keys plus modifiers' limit still applies.
- >I think this first appeared in Inside Macintosh IV or V, and I've not seen
- >anything about it since then. We've been through a few System software and
- >hardware revisions since then, so does this limit still apply ?
-
- The limit on the number of simultaneous keys being held down
- (and still detected) is a function of the keyboard and its driver.
-
- If I connect the keyboard that came with my SE to my LCIII, I only
- get 2 key rollover (regardless of the operating system version).
-
- If I connect a 3rd party keyboard to my LCIII, then I get
- many key rollover. I held down as many as I could at the same time
- and all keys were returned by the Event Manager.
-
-
-
- +++++++++++++++++++++++++++
-
- >From meggs@virginia.edu (Andrew Meggs)
- Date: Thu, 7 Dec 1995 23:10:22 GMT
- Organization: University of Virginia
-
- In article <49ufan$kgj@newsy.ifm.liu.se>, ingemar@lysator.liu.se (Ingemar
- Ragnemalm) wrote:
- >
- > Also, with events you *know* what key the user has hit. With GetKeys,
- > you only have the key code, you don't know what key it is. Assuming that
- > the key codes are the same on all keyboards is foolish. Dark Forces
- > does it, but that's no excuse. (The "+" key shinks the map and the "'"
- > key expands it - not good at all!)
- >
-
- Could you perhaps fill in my knowledge of Mac key mapping a little
- bit? GetKeys returns virtual key codes, not raw key codes, so presumably
- they've already been mapped through the KMAP resource. Other than the
- conversion to ASCII (at which point you lose the ability to distinguish
- between the keypad and the numbers on the main keyboard, and other such
- misfortunes), what translation is left after you've got a virtual
- key code?
-
- --
- _________________________________________________________________________
- andrew meggs the one who dies with the most
- meggs@virginia.edu AOL free trial disks wins
-
- +++++++++++++++++++++++++++
-
- >From hnsngr@sirius.com (Ron Hunsinger)
- Date: Fri, 08 Dec 1995 06:08:57 -0800
- Organization: ErsteSoft
-
- In article <30C635BA.203C@tiac.net>, fkane@phcteam.com wrote:
-
- > If a user depresses and holds 'A', 'S' and 'D', in that order, I expect that
- > we'll get KeyDowns for A and S but not D. Now, if the user releases
- these keys
- > in the opposite order, do we get a KeyUp for D with no matching KeyDown?
-
- Assuming that the keyboard doesn't get confused, here's what happens on a
- strict 2-key-rollover keyboard:
-
- 1) User presses A. Keyboard sends keyDown(A).
-
- 2) User presses S. Keyboard sends keyDown(S).
-
- 3) User presses D. Keyboard sends keyUp(A), then keyDown(D).
-
- 4) User releases A. Keyboard does nothing.
-
- 5) User releases S. Keyboard sends keyUp(S).
-
- 6) User releases D. Keyboard sends keyUp(D).
-
- At time (3), the keyboard knows that A is still down, but sends the keyUp
- for it anyway so that the computer will not 'see' more than two
- non-modifier keys down. Not all keyboards will do this, because not all
- keyboards are afraid to show more than two keys down.
-
- By "assuming that the keyboard doesn't get confuse", I'm referring to the
- fact that on many (most) keyboards, there are combinations of three keys,
- on three corners of a rectangle on the scanning grid, that will make the
- keyboard mistakenly think the key on the fourth corner is also pressed.
-
- My Apple Extended Keyboard (M3501) is happy to show "asdfhjcb," all at the
- same time (at which time I run out of fingers). It will not, however, show
- "afg" at the same time. In this sense, the limit seems to be that the
- keyboard only promises to faithfully report both of any two keys pressed.
- It makes no guarantee about what happens when more keys are pressed.
-
- The effect may in some cases be timing related. For example, if I press
- and hold "o" and then press "u" and "t" simultaneously, I may get "ot", or
- "ou", or "ou;". This has in fact been reported by several users: if you
- type "out" very quickly, you may get "ou;".
-
- Try playing with KeyCaps to see what you get on your keyboard. Ignore any
- auto-repeat, which is generated by the event manager and not by the
- keyboard. Keep in mind that not all your customers will have your
- keyboard.
-
- -Ron Hunsinger
-
- +++++++++++++++++++++++++++
-
- >From gordon@micron.net (Gordon Henriksen)
- Date: 9 Dec 1995 02:45:34 GMT
- Organization: Micron Internet Services
-
- In article <30C635BA.203C@tiac.net>, fkane@phcteam.com wrote:
-
- > Juri Munkki wrote:
- >
- > > The event record has the modifiers field that you can use. That's easy
- > > enough. The tricky thing is to detect dead keys. I forgot all about that
- > > until I tried to use a dead key in my app...it only worked every second
- > > time, since the first time was "dead".
-
- > I'm not 100% sure what you mean by a "dead key." Could you explain the
- > problem you're having a bit more? Are we talking about a bit too much dried
- > coffee sitting in a contact for a key, or some quirky event manager thing
- > related to handling more than two non-modifier keys being depressed
- > simultaneously?
-
- Fire up your favorite text/word processor. Type option-n. NOTHING happens.
- Now type a vowel. The vowel should appear with an accent mark that looks
- like a tilide (~) over it. The point of this is to extend the keyboard in
- such a way as to be able to type accent marks and have the keystrokes
- involved be somewhat intuitive. It is much easier than having to remember
- a specific keystroke for each letter's accent mark. The technique [sp?]
- also works on capitals just as would be expected. The reason the program
- didn't respond was because it simply wasn't notified of the stroke. The
- System obviously stores them in some internal variable, and there is no
- way that I am aware of to work around them using events.
-
- > This makes me think:
-
- > If a user depresses and holds 'A', 'S' and 'D', in that order, I expect that
- > we'll get KeyDowns for A and S but not D. Now, if the user releases these
- > keys in the opposite order, do we get a KeyUp for D with no matching KeyDown?
-
- No. Allow me to illustrate:
-
- User | Computer
- - ----+----------
- A | A
- AS | AS
- ASD | AS // 'd' depressed, but the keyboard doesn't see it
- AS | AS // 'd' released, but since the keyboard didn't see it, it
- | // doesn't respond
- A | A
-
- Since the keyboard usually can only detect two keys at a time, the 'd'
- wouldn't be registered at all. If we performed a similar operation as
- follows, I think that a 'd' KeyUp event would be registered without a
- corresponding KeyDown. On the other hand, it could result in a KeyUp as
- soon as the 'a' key is released.
-
- User | Computer
- - ----+----------
- A | A
- AS | AS
- ASD | AS // 'd' is also depressed, but the keyboard doesn't see it
- SD | SD // now it sees it. Does it generate a KeyUp or nothing?
- D | D
-
- Anyone care to tell us what would really happen? I find this discussion
- fascinating because I was not actively aware of this limitation to the
- standard keyboard.
-
- TTFN,
- Gordon Henriksen
- gordon@micron.net
- __________________________________________________
- HAL 9000: Dave. Put down those Windows disks, Dave. DAVE!
- __________________________________________________________________
- Microsoft is prohibited from redistributing this work in any form,
- in whole or in part. Copyright, Gordon Henriksen, 1995. License to
- distribute this post is available to Microsoft for $150. Posting
- without permission constitutes an agreement to these terms. Please
- send notices of violation to gordon@micron.net and
- Postmaster@microsoft.com
-
- +++++++++++++++++++++++++++
-
- >From albtrssp@crocker.com (Kevin Tieskoetter)
- Date: 7 Dec 1995 21:27:13 GMT
- Organization: Albatross Productions
-
- In article <reed-0612950944190001@thomasmac.wustl.edu>
- reed@medicine.wustl.edu (Thomas Reed) writes:
-
- > >First is that one problem with events is as far as I can tell you won't
- > >receive notification of a user pressing a modifier key.
- >
- > Yeah, but every event has got bits telling what modifiers were down at the
- > time. You can always do something like scan for nullEvents and check the
- > modifiers in the event. The system always has nullEvents to spare, so
- > you'll never go looking for one and come up dry...
-
- That doesn't seem to make much sense - why deliberately look for a null
- event just so you can see what modifiers were being held down when that
- null event took place? (is the modifier field even valid for null
- events?) If you always know you're going to get a null event (I'm not
- sure this is true), why not just call GetKeys() instead?
-
- -kevin
-
- //---------------------------------------------------------------------
- Kevin Tieskoetter / Software Prestidigitator, Specular International
- //---------------------------------------------------------------------
-
- +++++++++++++++++++++++++++
-
- >From albtrssp@crocker.com (Kevin Tieskoetter)
- Date: 7 Dec 1995 21:29:32 GMT
- Organization: Albatross Productions
-
- In article <gordon-0512951741350001@cs001p06.ket.micron.net>
- gordon@micron.net (Gordon Henriksen) writes:
-
- > Okay, it seems to me that most people have decided to go with the Event
- > Manager to track keys. I only have one problem with this: How does one
- > track modifier keys this way? Most programs don't need it, but games ARE
- > the exception of most every rule. Anyway....
-
- What I do is call WaitNextEvent every 5 ticks or so, then call
- GetKeys() every other time. I can track modifier keys through
- GetKeys(), plus the rest of the system gets time to work. There's not
- much point in calling WaitNextEvent() several times a second, which is
- what many programs end up doing since they made assumptions about the
- processor speed which weren't true...
-
- -kevin
-
- //---------------------------------------------------------------------
- Kevin Tieskoetter / Software Prestidigitator, Specular International
- //---------------------------------------------------------------------
-
- +++++++++++++++++++++++++++
-
- >From thebug@berlin.snafu.de (TheBug)
- Date: Thu, 07 Dec 1995 14:05:46 +0100
- Organization: privat
-
- In article <30C635BA.203C@tiac.net>, fkane@phcteam.com wrote:
-
- > I'm not 100% sure what you mean by a "dead key." Could you explain the
- problem
- > you're having a bit more?
-
- Dead keys generate no KeyDown event on the first pressing down, like the
- accent character key. Since these keys can be on different locations in
- different quantities, depending on the language being used this is a BIG
- problem.
-
- > If a user depresses and holds 'A', 'S' and 'D', in that order, I expect that
- > we'll get KeyDowns for A and S but not D. Now, if the user releases
- these keys
- > in the opposite order, do we get a KeyUp for D with no matching KeyDown?
-
- You will never see a KeyUp for which there was no KeyDown. What I wuld
- guess in your case is that you can get an additional KeyDown for a key
- that is not acutally pressed. This is due to the fact the keyboards are
- arranged in matrixes. If you press three keys in a certain pattern in the
- matrix you will see another key as being pressed, even though it actually
- is'nt. To prevent this you would have to put diodes all over the matrix.
- Due to production cost this is almost never done.
-
- --
- *******************************************************************
- Guido Körber - Programmer and hardware hacker
- thebug@berlin.snafu.de Specialised in mistreating the ADB
- fax: x49-30-773 81 36 Ask me about:
- Flightstick Pro, Jetstick
- MacEnjoy, MacEnjoy Style
-
- Opinions expressed herein are mine unless expressly stated
- otherwise. Similarities with living or undead persons are
- coincidence and not intended - really! ;-)
- Best use before: (see date printed on backside of message)
- *******************************************************************
-
- ---------------------------
-
- >From timmyd@netcom.com (Tim DeBenedictis)
- Subject: How do I draw dashed lines?
- Date: Thu, 7 Dec 1995 07:36:50 GMT
- Organization: NETCOM On-line Communication Services (408 261-4700 guest)
-
- In Windows GDI, there is an option to create a "dashed" pen, and anything
- you draw with that pen will have a dashed-line appearance (squares,
- circles, etc.) Does Mac QuickDraw have anything similar? I know you
- could always just set the PenPat, but that's not what I'm looking for: I
- want an honest-to-god, genuine dashed-line pen. Am I going to have to
- write my own DrawDashedLine() routine (which, I assume, would consist of
- a bunch of LineTo()/MoveTo() calls)? If so, can anybpdy present me with
- a simple algorithm, or better yet sample code?
-
- Thanks!
-
- -Tim DeBenedictis
- timmyd@netcom.com
-
-
- +++++++++++++++++++++++++++
-
- >From vision@cc.swarthmore.edu (Frank Durgin, Stephen Sample, and various student researchers)
- Date: Mon, 11 Dec 1995 09:06:41 -0500
- Organization: Swarthmore Visual Perception Lab
-
- In article <timmydDJ7H5E.HEC@netcom.com>, timmyd@netcom.com (Tim
- DeBenedictis) wrote:
-
- > In Windows GDI, there is an option to create a "dashed" pen, and anything
- > you draw with that pen will have a dashed-line appearance (squares,
- > circles, etc.) Does Mac QuickDraw have anything similar? I know you
- > could always just set the PenPat, but that's not what I'm looking for: I
- > want an honest-to-god, genuine dashed-line pen.
-
- Well, GX supports dashed pens (with arbitrary dash shapes yet!) so you
- could use that. It would give you lots of other really cool graphics
- features more or less for free, too, but, OTOH, you'd have to require GX
- (or Copland).
-
-
- Ta,
- -Stephen
-
- --
- Frank Durgin, Stephen Sample, & various student researchers
- - --------------------------
- Visual Perception Laboratory
- Department of Psychology
- Swarthmore College
-
- ---------------------------
-
- >From Frank Kane <fkane@tiac.net>
- Subject: Network code on a PPC native project?
- Date: Sun, 03 Dec 1995 09:44:06 +0000
- Organization: Cerberus Development
-
- Just got my copy of Tricks of the Mac Game Programming Gurus, began
- reading the chapter on networking, got all inspired, and decided I'd
- add network play to my current project.
-
- But then you get to a little aside that says "oh by the way, you
- need to use 68K assembly for the callback routines, if you're making
- a PowerPC native game, sorry, thanks for playing. It's possible,
- but good luck." Well, not in those words exactly.
-
- Now, I know it's possible to get the Mixed Mode Manager to use 68K
- code from a PowerPC app, via UPP's or something. Personally, I have
- no clue how UPP's work unless they're set up for me in a header
- file.
-
- Does anybody have any experience in handling networks from a PPC
- native app? How do you use the 68K assembly from a PPC project?
- (Besides trying to use the new Open Transport calls instead) Do I
- need to somehow get the 68K code in a resource or something?
-
- Thanks!
- -Frank
-
- +++++++++++++++++++++++++++
-
- >From ajbarry@ozemail.com.au (Andrew Barry)
- Date: Thu, 07 Dec 1995 14:53:48 +1000
- Organization: Interconnect Australia
-
- > Does anybody have any experience in handling networks from a PPC
- > native app? How do you use the 68K assembly from a PPC project?
- > (Besides trying to use the new Open Transport calls instead) Do I
- > need to somehow get the 68K code in a resource or something?
-
- Ran into exactly this problem when doing the PowerPC version of 'Prince of
- Destruction' - my DDP socket listener was written as a code resource,
- which I then loaded and created a UPP to it.
-
- If you look in AppleTalk.h, you'll notice upp info definitions for the
- various procs. eg. uppDDPSocketListenerProcInfo
-
- ---------------------------
-
- >From vanessa@io.org (Vanessa Williams)
- Subject: Spheres in Q3D?
- Date: Sat, 09 Dec 1995 22:00:40 -0500
- Organization: Tessera Solutions
-
- Anyone have any ideas on the best way to render spheres, cylinders etc. in
- QuickDraw 3D? I'm assuming NURB surfaces are the way to go, but don't know
- exactly how to specify basic surfaces using NURBS. All of the info I have
- on NURBS is very theoretical, no practical examples to speak of (i.e.
- Foley and Van Dam). Any ideas or pointers appreciated.
-
- Thanks,
-
- Vanessa
-
- --
- Vanessa Williams
- Tessera Solutions, Interactive Graphics & Multimedia
- vanessa@io.org
- http://www.io.org/~vanessa/
-
- +++++++++++++++++++++++++++
-
- >From ashearer@mail.rihosp.edu (Andrew Shearer)
- Date: Mon, 11 Dec 1995 20:50:18 -0500
- Organization: Rhode Island Hospital
-
- In article <vanessa-0912952200400001@ts7-15.inforamp.net>, vanessa@io.org
- (Vanessa Williams) wrote:
-
- >Anyone have any ideas on the best way to render spheres, cylinders etc. in
- >QuickDraw 3D? I'm assuming NURB surfaces are the way to go, but don't know
- >exactly how to specify basic surfaces using NURBS. All of the info I have
- >on NURBS is very theoretical, no practical examples to speak of (i.e.
- >Foley and Van Dam). Any ideas or pointers appreciated.
-
- One of the pieces of QD3D sample code (TriGrids?) has a sphere creation
- routine. It doesn't add vertex normals, though, so the sphere looks
- faceted even with vertex interpolation on.
-
- Here's a version modified to add normals. (I removed some extra code
- before posting; hopefully, I didn't break anything.) 1.5 is a good value
- for inQuality. CheckQ3Object() and CheckQ3Status() are error-checking
- routines.
-
- TQ3GeometryObject
- MakeSphere(
- float inRadius,
- float inQuality)
- {
- /*
- * vvValue is an angle used to generate each half circular cross section
- * uuValue is an angle used to revolve the cross section about the y axis
- */
- const float vvMin = -kQ3PiOver2, vvMax = kQ3PiOver2;
- const float uuMin = 0.0, uuMax = kQ32Pi;
- const unsigned long theNumRows = (6 * inQuality) + 1, theNumColumns =
- (10 * inQuality) + 1;
-
- StPointerBlock theVerticesPtr(theNumRows * theNumColumns *
- sizeof(TQ3Vertex3D));
- TQ3Vertex3D *theVertices = (TQ3Vertex3D*) Ptr(theVerticesPtr);
- // Non-PowerPlant C version:
- // TQ3Vertex3D *theVertices = (TQ3Vertex3D *) ::NewPtr (theNumRows *
- theNumColumns * sizeof(TQ3Vertex3D));
- // ThrowIfMemFail_(theVertices);
-
- const float uuStep = (uuMax - uuMin) / (theNumColumns - 1);
- const float vvStep = (vvMax - vvMin) / (theNumRows - 1);
-
- for (unsigned long theRow = 0; theRow < theNumRows; theRow++) {
- for (unsigned long theColumn = 0; theColumn < theNumColumns;
- theColumn++) {
- const float uuRadians = uuMax - theColumn * uuStep;
- const float vvRadians = vvMin + theRow * vvStep;
- TQ3Vertex3D &theVertex = theVertices[theColumn + theRow *
- theNumColumns];
- const TQ3Vector3D theNormal =
- {cos(vvRadians) * cos(uuRadians), sin(vvRadians),
- cos(vvRadians) * sin(uuRadians)};
-
- theVertex.point.x = inRadius * theNormal.x;
- theVertex.point.y = inRadius * theNormal.y;
- theVertex.point.z = inRadius * theNormal.z;
- theVertex.attributeSet = CheckQ3Object(Q3AttributeSet_New());
- CheckQ3Status(Q3AttributeSet_Add(theVertex.attributeSet,
- kQ3AttributeTypeNormal, &theNormal));
- }
- }
-
- const TQ3TriGridData data =
- {theNumRows, theNumColumns, theVertices, nil /*facetAttributeSet*/,
- nil /*triGridAttributeSet*/};
- TQ3GeometryObject outResult = Q3TriGrid_New(&data);
-
- for (long i = 0; i < theNumRows * theNumColumns; i++) {
- CheckQ3Status(Q3Object_Dispose(theVertices[i].attributeSet));
- }
-
- // C version:
- //::DisposePtr((Ptr)theVertices);
-
- return CheckQ3Object(outResult);
- }
-
- --
- Andrew Shearer
- Regular email: ashearer@mail.rihosp.edu
- (may be changing to ashearer@rihosp.edu)
-
- ---------------------------
-
- >From dway@PROBLEM_WITH_INEWS_GATEWAY_FILE (Douglas E. Way)
- Subject: WaitNextEvent & Background Processing
- Date: 6 Dec 1995 20:48:56 GMT
- Organization: ECC at Ford Motor Company, Dearborn Michigan
-
- Juri Munkki (jmunkki@gamma.hut.fi) wrote:
- > In article <49ufan$kgj@newsy.ifm.liu.se> ingemar@lysator.liu.se (Ingemar
- Ragnemalm) writes:
- > >It makes a big difference if you use WNE with a sleep time > 0, or have
- > >lots of applications in the background.
- >
- > During games, I never call WNE. I may call GetNextEvent, if the user
- > has background processing enabled, but the best thing is usually to
- > call only GetOSEvent, since it doesn't allow any background processing.
-
- (I wanted to start a new thread on this, since I had some questions about
- WaitNextEvent.)
-
- I'm writing a game in which I'm NOT calling WaitNextEvent (or anything
- similar) unless the user decides to enable "background processing" in a
- preferences dialog. My initial impression was that if I didn't call
- WaitNextEvent, I wouldn't have to worry about background processes taking up
- valuable CPU time.
-
- However, when I was testing the frame rate, I noticed a weird thing. If I had
- extensions turned off, the frame rate was around 360 frames/sec. If I turned
- extensions on, the frame rate was about 270 frames/sec. (You're probably
- thinking that's damn fast anyway, but this is on a 7200/90 and I still have to
- add a lot more complexity to the game.) It turned out that the main culprit
- was AfterDark (2.0). If I removed AfterDark, the frame rate was about the
- same whether other extensions were on or off.
-
- So I'm wondering, are there certain kinds of background processes that can
- occur whether or not I'm calling WaitNextEvent? (I'm sure the After Dark
- thing is not a RAM issue, the System and the game each take up about 5 megs on
- my 16 meg machine... also, I'm wondering why AfterDark would need to chew up
- so many resources just checking for inactivity.) Or, could it be that some
- other toolbox routine I'm calling somehow allows for event processing? I
- thought only WaitNextEvent and GetNextEvent did this. To be fair, I do use
- WaitNextEvent for the menu interface (for starting a new game, etc), but this
- is outside of the game loop where I'm testing the frame rates.
-
- (Also, I'm curious as to why Juri calls GetNextEvent rather than
- WaitNextEvent. Is it more efficient?)
-
- Any ideas? (Please post rather than emailing me.)
-
- - Doug Way
- deway@umich.edu
- Bebound!
-
-
- +++++++++++++++++++++++++++
-
- >From Frank Kane <fkane@tiac.net>
- Date: Wed, 06 Dec 1995 19:07:43 -0500
- Organization: Cerberus Development
-
- Douglas E. Way wrote:
-
- > However, when I was testing the frame rate, I noticed a weird thing. If I had
- > extensions turned off, the frame rate was around 360 frames/sec. If I turned
- > extensions on, the frame rate was about 270 frames/sec. (You're probably
- > thinking that's damn fast anyway, but this is on a 7200/90 and I still have to
- > add a lot more complexity to the game.) It turned out that the main culprit
- > was AfterDark (2.0). If I removed AfterDark, the frame rate was about the
- > same whether other extensions were on or off.
-
- I'm no expert on how After Dark works (or on much else for that matter,) but I do
- know that neglecting WaitNextEvent will do nothing to stop tasks that run on
- interrupts. File Sharing is a good example, and it's probably a good bet that
- After Dark does too. I'm probably oversimplifying, but apps like this will eat
- up CPU time whenever the screen gets redrawn (every 1/60 second) whether or not
- you give them time with WaitNextEvent.
-
- If speed is critical, it's usually a good idea to give the user the option to
- kill file sharing and the finder when starting up your game. There's some code
- to do this available at ftp.info.apple.com if you hunt long enough (look for a
- game folder, it's in there.)
-
- Hope this helps somewhat...
-
- -Frank
-
- +++++++++++++++++++++++++++
-
- >From jregier@qualcomm.com (Jason Regier)
- Date: Wed, 06 Dec 1995 17:14:11 -0800
- Organization: Qualcomm, Inc.
-
- Regarding slowdowns with After Dark installed:
- >
- > I'm no expert on how After Dark works (or on much else for that matter,)
- but I > do know that neglecting WaitNextEvent will do nothing to stop
- tasks that run
- > on interrupts. I'm probably oversimplifying, but apps like this will eat
- > up CPU time whenever the screen gets redrawn (every 1/60 second) whether or
- > not you give them time with WaitNextEvent.
- >
- AfterDark most likely has to install some periodic interrupt (it doesn't
- necessarily have to be tied to the 60 Hz vertical retrace clock) in order
- to turn on when your mouse is placed in the corner. When the interrupt
- executes, it takes over the processor (thus stalling your application),
- checks the mouse position, and relinquishes control of the processor back
- to your app. You most likely notice the lag incurred by checking the
- mouse position and switching contexts between your app and AfterDark.
-
- Assuming this is the case, kill AfterDark, and your problem will go away,
- just as you found.
-
- Jason
-
- --
- Jason Regier
- GlobalStar Software Engineer
- QUALCOMM, Inc.
- (619) 658-4752
- jregier@qualcomm.com
-
- +++++++++++++++++++++++++++
-
- >From erichsen@pacificnet.net (Erichsen)
- Date: 7 Dec 1995 04:21:40 GMT
- Organization: Disorganized
-
- In article <4a4vjo$cbl@eccdb1.pms.ford.com>,
- dway@PROBLEM_WITH_INEWS_GATEWAY_FILE (Douglas E. Way) wrote:
-
-
- >However, when I was testing the frame rate, I noticed a weird thing. If I had
- >extensions turned off, the frame rate was around 360 frames/sec. If I turned
- >extensions on, the frame rate was about 270 frames/sec. (You're probably
- >thinking that's damn fast anyway, but this is on a 7200/90 and I still have to
- >add a lot more complexity to the game.) It turned out that the main culprit
- >was AfterDark (2.0). If I removed AfterDark, the frame rate was about the
- >same whether other extensions were on or off.
-
- The slowdown has nothing to do with background processing, it's extensions
- patching traps. After Dark does this like it's going out of style. I'm not
- sure if they've fixed it yet or not but, a lot of the stuff it patches is
- replaced with 680x0 code which may be fine on a 680x0 machine but, on a
- PowerPC if they patch something that is native, it's going to run emulated
- and really slow you down.
-
- You should try doing everything correctly (ie. calling WaitNextEvent and
- processing events) and see what kind of speed you get. If you're not
- getting the speed you want, try to improve your algorithms and as a VERY
- last resort, limit your calls to WaitNextEvent. Don't just stop calling
- it, throttle it so you can adjust how often it's called and decrease this
- until you get the speed you need.
-
- +++++++++++++++++++++++++++
-
- >From jmunkki@gamma.hut.fi (Juri Munkki)
- Date: 7 Dec 1995 10:57:29 GMT
- Organization: Helsinki University of Technology
-
- In article <4a4vjo$cbl@eccdb1.pms.ford.com> dway@PROBLEM_WITH_INEWS_GATEWAY_FILE (Douglas E. Way) writes:
- >I'm writing a game in which I'm NOT calling WaitNextEvent (or anything
- >However, when I was testing the frame rate, I noticed a weird thing. If I had
- >extensions turned off, the frame rate was around 360 frames/sec. If I turned
- >extensions on, the frame rate was about 270 frames/sec. (You're probably
- >thinking that's damn fast anyway, but this is on a 7200/90 and I still have to
- >add a lot more complexity to the game.) It turned out that the main culprit
- >was AfterDark (2.0). If I removed AfterDark, the frame rate was about the
- >same whether other extensions were on or off.
-
- It needs to monitor what is happening on the machine, so I guess it patches
- here and there and since it's probably not a fat extension, the patches
- make the PPC emulate 68K code and thus slow it down (cache deteriorates
- fast with 68K emulation).
-
- It could also be installing time manager tasks for some reason.
-
- >other toolbox routine I'm calling somehow allows for event processing? I
- >thought only WaitNextEvent and GetNextEvent did this. To be fair, I do use
- >WaitNextEvent for the menu interface (for starting a new game, etc), but this
- >is outside of the game loop where I'm testing the frame rates.
-
- The best you can do is call GetOSEvent. The rest is left up the the
- users. Try to warn them that the game will run faster without extensions.
- Then again, everything runs faster without extensions, so they might
- already know.
-
- Debuggers also tend to slow down the machine.
-
- >(Also, I'm curious as to why Juri calls GetNextEvent rather than
- >WaitNextEvent. Is it more efficient?)
-
- Just old habit. The main application calls WaitNextEvent, but GetNextEvent
- is a bit simpler and does the same thing. It probably gets translated into
- a WaitNextEvent. It shouldn't matter unless you want to be compatible with
- historical Macs.
-
- --
- Juri Munkki jmunkki@iki.fi In cyberspace everyone can hear you scream.
- http://www.iki.fi/~jmunkki Windsurfing: Faster than the wind.
-
- +++++++++++++++++++++++++++
-
- >From mwhid@native.cis.ufl.edu (Michael C. Whidden)
- Date: 7 Dec 1995 14:54:36 GMT
- Organization: Univ. of Florida CIS Dept.
-
- >However, when I was testing the frame rate, I noticed a weird thing. If I had
- >extensions turned off, the frame rate was around 360 frames/sec. If I turned
- >extensions on, the frame rate was about 270 frames/sec. (You're probably
-
- >So I'm wondering, are there certain kinds of background processes that can
- >occur whether or not I'm calling WaitNextEvent? (I'm sure the After Dark
- >thing is not a RAM issue, the System and the game each take up about 5 megs on
- Yes. Interrupt handling routines execute and there's nothing (realistically)
- you can do about it. Interrupt routines do things like redraw the screen,
- listen to your modem, play your sounds, etc... My guess is that AfterDark
- is installing a routine that executes at regular, timed intervals for the
- purposes of figuring out how long it has been since you last moved the
- mouse or pressed a key. (so that it can turn on after 15 minutes of
- idle time or whatnot.) Not much you can do about it.
-
- -Mike
-
-
- --
- /\ /| | mwhid@cis.ufl.edu
- | \ | | \ | cirop34@grove.circa.ufl.edu
- / | | | @ | / | hubris@ufcc.ufl.edu
- / \| | \ |/ ___ |And don't miss all the great
-
- +++++++++++++++++++++++++++
-
- >From donarb@wolfenet.com (Don Arbow)
- Date: Thu, 07 Dec 1995 13:50:25 -0700
- Organization: Wolfe Internet Access, L.L.C.
-
- In article <4a4vjo$cbl@eccdb1.pms.ford.com>,
- dway@PROBLEM_WITH_INEWS_GATEWAY_FILE (Douglas E. Way) wrote:
-
- : Juri Munkki (jmunkki@gamma.hut.fi) wrote:
- : > In article <49ufan$kgj@newsy.ifm.liu.se> ingemar@lysator.liu.se (Ingemar
- : Ragnemalm) writes:
- : > >It makes a big difference if you use WNE with a sleep time > 0, or have
- : > >lots of applications in the background.
- : >
- : > During games, I never call WNE. I may call GetNextEvent, if the user
- : > has background processing enabled, but the best thing is usually to
- : > call only GetOSEvent, since it doesn't allow any background processing.
- :
- : (I wanted to start a new thread on this, since I had some questions about
- : WaitNextEvent.)
- :
- : I'm writing a game in which I'm NOT calling WaitNextEvent (or anything
- : similar) unless the user decides to enable "background processing" in a
- : preferences dialog. My initial impression was that if I didn't call
- : WaitNextEvent, I wouldn't have to worry about background processes taking up
- : valuable CPU time.
- :
- : However, when I was testing the frame rate, I noticed a weird thing.
- If I had
- : extensions turned off, the frame rate was around 360 frames/sec. If I
- turned
- : extensions on, the frame rate was about 270 frames/sec. (You're probably
- : thinking that's damn fast anyway, but this is on a 7200/90 and I still
- have to
- : add a lot more complexity to the game.) It turned out that the main culprit
- : was AfterDark (2.0). If I removed AfterDark, the frame rate was about the
- : same whether other extensions were on or off.
- :
-
- One of the problems with calling WNE, is that it is not native. It is
- still 68k code,
- so each time you call it on the PowerPC, it requires a Mixed Mode switch.
- Every Mixed
- Mode switch requires the execution of approximately 500 PowerPC instructions.
-
- An interesting experiment as shown in the book "Programming the PowerPC" shows
- a simple program that draws some output on the screen. It loops 10,000 times.
- The first version of the program ran in 8 seconds. By adding a call to
- WNE to allow the
- user to jump out of the loop by pressing a key, execution time was
- increased to 30 seconds,
- because of the overhead of Mixed Mode calls.
-
- If you're calling WNE on a PowerPC, make sure you don't call it every time
- through
- your event loop. Mixed mode thrashing causes a lot of slowdowns with
- WNE. I use
- a timing variable that only calls WNE every 15 ticks when running on a PowerPC.
- That will effectively speed up your event loop.
-
- Don
-
- --
- - ------------------------------------------------------------------------
- \ | / Don Arbow, Partner | donarb@wolfenet.com
- -- EDO -- EveryDay Objects, Inc. | http://www.pla-net.net/edo
- / | \ Seattle, WA |
- - ------------------------------------------------------------------------
- My Prographing web page: http://www.wolfe.net/~donarb/Dataflow.html
- "The fix is only temporary, unless it works" - Red Green
- - ------------------------------------------------------------------------
-
- +++++++++++++++++++++++++++
-
- >From tt@muc.de (Thomas Tempelmann)
- Date: Fri, 08 Dec 1995 12:46:51 +0100
- Organization: MUC.DE e.v -- private Internet access
-
- In article <4a4vjo$cbl@eccdb1.pms.ford.com>,
- dway@PROBLEM_WITH_INEWS_GATEWAY_FILE (Douglas E. Way) wrote:
-
- >I'm writing a game in which I'm NOT calling WaitNextEvent (or anything
- >similar) unless the user decides to enable "background processing" in a
- >preferences dialog.
-
- I do that in my games (from Dongleware, e.g. OXYD, Tubular Worlds), too.
- It seems to work good.
- But if you do not call WNE but GetOSEvent, you should also call SystemTask
- around every 1/60 second (at most) in order to allow drivers to get some
- time if they require it. It makes it a little bit more compatible and will
- not consume much time, since the drivers are asked no to perform
- time-consuming tasks here.
- At least, I had the impression that PowerBooks need that SystemTask call
- (which is performed implecitly when you use WNE) in order to control HD
- spin down and similar tasks.
- Although I'm not 100% sure about this, it is just a good idea to call
- SystemTask anyway.
-
- Thomas
-
- - -
- Thomas Tempelmann, Tuerkenstr. 31, D-80799 Muenchen, Germany.
- E-mail: tt@muc.de (private), tempel@eWorld.com (business)
- Phone: (++49) (89) 286590-90, Fax -89
-
- +++++++++++++++++++++++++++
-
- >From hnsngr@sirius.com (Ron Hunsinger)
- Date: Fri, 08 Dec 1995 07:01:06 -0800
- Organization: ErsteSoft
-
- In article <4a4vjo$cbl@eccdb1.pms.ford.com>,
- dway@PROBLEM_WITH_INEWS_GATEWAY_FILE (Douglas E. Way) wrote:
-
- > I'm writing a game in which I'm NOT calling WaitNextEvent (or anything
- > similar) unless the user decides to enable "background processing" in a
- > preferences dialog. My initial impression was that if I didn't call
- > WaitNextEvent, I wouldn't have to worry about background processes taking up
- > valuable CPU time.
- >
- > However, when I was testing the frame rate, I noticed a weird thing. If
- I had
- > extensions turned off, the frame rate was around 360 frames/sec. If I turned
- > extensions on, the frame rate was about 270 frames/sec. (You're probably
- > thinking that's damn fast anyway, but this is on a 7200/90 and I still
- have to
- > add a lot more complexity to the game.) It turned out that the main culprit
- > was AfterDark (2.0). If I removed AfterDark, the frame rate was about the
- > same whether other extensions were on or off.
-
- The problem here is that AfterDark patches a lot of system traps. In
- version 2.0, the patches are all 68K code, so that if native code calls
- one of the patched traps, you have two mode switches: one from native mode
- to emulator mode, and then another one just a few instructions later to go
- back to native mode. These mode switches are very expensive.
-
- Version 3.0 of AfterDark makes fat patches, so you won't have this
- slowdown if you upgrade.
-
- > So I'm wondering, are there certain kinds of background processes that can
- > occur whether or not I'm calling WaitNextEvent?
-
- As other people have told you, interrupt routines still run even if you
- don't call WNE.
-
- I applaud your decision to make it a user preference whether to give time
- to background tasks. Just because I'm playing a game doesn't mean I don't
- have anything else going on. I usually want to let background tasks get
- their time, and if they take too much I'll either quit them or (if the
- game allows) starve them. I don't want the game to make that decision for
- me. A game that takes over the whole machine is a game that I cannot
- always afford to run.
-
- You can can use the event manager and still starve background tasks if you
- want by calling GetOSEvent instead of WaitNextEvent or GetNextEvent. But:
-
- If you starve background tasks, they can't update their windows. This may
- look ugly. Even if your game (impolitely) takes over the whole screen, the
- user may have other screens with windows on them.
-
- Some screen savers won't work if background tasks don't get time. Yes, I
- know your game is wonderful, but my phone still rings, people still come
- to the door, and sometime I have to leave the game unattended for a while.
-
- > (Also, I'm curious as to why Juri calls GetNextEvent rather than
- > WaitNextEvent. Is it more efficient?)
-
- WaitNextEvent calls GetNextEvent. WaitNextEvent with a sleep time of zero
- is the same as SystemTask;GetNextEvent. Unless you have desk accessories
- running in your heap (extremely unlikely), SystemTask doesn't do anything,
- so in this case WNE and GNE are equivalent.
-
- (Actually, as I write this, I suddenly find myself unsure. Is it
- SystemTask or GetNextEvent that gives time to background processes? I know
- they hang on a GNE waiting for the time, and get it with a nullEvt, but
- that doesn't of itself demand that the front process give up the time with
- GNE.)
-
- The advantage of WNE over GNE comes when the sleep time is greater than
- zero. In this case, WNE is more efficient about giving time to background
- tasks, because it knows how much it can starve the foreground task. But
- then, you probably aren't actively seeking ways to starve your action-type
- game.
-
- -Ron Hunsinger
-
- +++++++++++++++++++++++++++
-
- >From reed@medicine.wustl.edu (Thomas Reed)
- Date: Mon, 11 Dec 1995 09:23:06 -0600
- Organization: Washington University
-
- In article <4a4vjo$cbl@eccdb1.pms.ford.com>,
- dway@PROBLEM_WITH_INEWS_GATEWAY_FILE (Douglas E. Way) wrote:
-
- >(Also, I'm curious as to why Juri calls GetNextEvent rather than
- >WaitNextEvent. Is it more efficient?)
-
- WaitNextEvent basically calls GetNextEvent and SystemTask. By calling
- GetNextEvent, you get that portion without the automatic allocation of
- time to the system. Of course, you could do the same thing with the right
- sleep value passed to WaitNextEvent...
-
- -Thomas
-
- =====================================================
- Thomas Reed Washington University
- reed@visar.wustl.edu Medical School
- reed@medicine.wustl.edu Saint Louis, MO
- http://medinfo.wustl.edu/~reed
- - ---------------------------------------------------
- Clothes make the man. Naked people have little or no
- influence on society. -- Mark Twain
- =====================================================
-
- Opinions posted are not the opinions of Wash. U.
-
- ---------------------------
-
- End of C.S.M.P. Digest
- **********************
-